X hits on this document

Word document

click on “Load Preferences”; (4) click on “Factory Settings.” If the ... - page 34 / 44

475 views

0 shares

0 downloads

0 comments

34 / 44

Converting the variable “stideoan” (state ideology) from annual data to average scores for presidential administrations over the 1973-2008 period and having the average score read for each year (i.e., the average of 1973, 1974, 1975 and 1976 read for each of those same four years) type:

use c:/StataTechnicalSupportVersion, clear

set more off

gen term=0

forvalues i = 1973(4)2008 {

replace term=1 if year==`i'

}

bysort stnum: replace term=sum(term)

bysort stnum term: egen term_avg=mean(stideoan)

set more on

exit

The variable “term_avg” was what you were after.

“DO” File: Partisan Strength Variables:

Creating Alt/Lowry’s Political Control Variables (Demcont = 1 = Democratic governor plus Democratic control of both houses of the legislature, 0 = other; Repcont = 1 = Republican governor plus Republican control of both houses of the legislature, other = 0; DS = 1 = Democratic governor and Split Legislature – one house majority Democratic and the other majority Republican, 0 = other; DR = 1= Democratic Governor and Republican control of both houses of the legislature, other = 0; RS = 1 = Republican governor and one house majority Republican and the other house majority Democratic, other = 0; and RD = 1 = Republican governor and Democratic majorities in both houses of the legislature, other = 0).    

use "F:\statedata8.dta", clear

tsset stnum year, yearly

//The following commands generate Alt/Lowry Political Variables and Unified //Partisan Control Variables at the State Level

drop demcont repcont ds dr rs rd  

drop lhdemp uhdemp lhdemc uhdemc lhrepp uhrepp lhrepc uhrepc

gen lhtot = lhdem + lhrep

gen lhdemp = lhdem/lhtot

gen lhrepp= lhrep/lhtot

gen uhtot = uhdem + uhrep

gen uhdemp = uhdem/uhtot

gen uhrepp= uhrep/uhtot

gen lhdemc= lhdemp

recode  lhdemc (.0000/.5 = 0) (.5001/1 = 1)

gen uhdemc= uhdemp

recode  uhdemc (.0000/.5 = 0) (.5001/1 = 1)

Document info
Document views475
Page views539
Page last viewedMon Jan 23 17:54:37 UTC 2017
Pages44
Paragraphs843
Words17107

Comments