Hi Zelig Helplist,
I've am looking to add a covariate to several ei.RxC models I have run. But
I've run into several problems. I think I may be issuing a command
incorrectly...
When I added a covariate to my model, my output changed slightly. But then
I realized that no matter the covariate I was using, the output was the
same each time (i.e. the output was the same regardless of the covariate
used...)! In another model, when I added a covariate, the output didn't
change at all. And I was remembering to set the covariate to its mean.
The identity columns I am using are numbers of individuals, as opposed to
percents. So I was thinking that the problem was I was using a covariate
that was a decimaled percent. I replaced with the whole number equivalent
and the same result occurred.
I'm attaching a picture of the end of my dataset to this email. You'll see
that the ethnic categories I'm using, such as Mo and Sisala, are reported
in whole population numbers. The covariate I am attempting to use is
percentage of urban residents in a particular district. 'urban' is listed
as a decimaled proportion, but I also tried 'urban2' which is a whole
population number (i.e. the district pop total * urban).
Below is some sample code:
STATA <- read.dta(file.choose())
#using 2012registrationtoEstimates
View(STATA)
set.seed(7)
z.out <- zelig(cbind(registeredvoters, nonregistered) ~ agona + ahafo +
ahanta + akuapem + akwamu + akyem + aowin + asante + asen + boron + chokosi
+ denkyira + evalue + fante + kwahu + nzema + sefwi + wasa + bawle +
otherakan + dangme + ga + otherga + ewe + guan1 + guan2 + guan3 + guan4 +
guan5 + guan6 + guan7 + guan8 + otherguan + bimoba + kokomba + basare +
pilapila + salfalba + kotokoli + chamba + othergurma + builsa + dagarte +
wali + dagomba + kusasi + mamprusi + namnam + nankansi + nanumba + mosi +
othermole + kasena + mo + sisala + vagala + othergrusi1 + othergrusi2 +
busanga + wangara + othermande + otherinside + otheroutside, COVAR =
~urban2, model = "ei.RxC", data = STATA)
x.out <- setx(z.out)
s.out <- sim(z.out, num = 100)
var7 <- summary(s.out)
dataframe=as.data.frame(var7$qi.stats)
write.dta(dataframe, "2012regisURBANnew.dta")
regis2012URB <- read.table(file.choose(), header=TRUE)
View(regis2012URB)
stargazer(regis2012URB[ , ], style="apsr", rownames=FALSE, summary=FALSE)
Thanks very much,
Jennifer
--
PhD Candidate
Department of Political Science
University of Florida
PO Box 117325
Gainesville, FL 32611-7325
Show replies by date