I have a few questions about endogenous predictor variables in zelig models
& simulations. I'm new to this kind of statistics, so I could be overlooking
something obvious -- any help or guidance very much appreciated!
1. What is the appropriate method for instrumenting an ordinal endogenous
predictor variable? (The variable has 5 levels.)
2. What is the appropriate way to derive or simulate a quantity of interest
in a 2-stage regression (or an SEM or other path model) based on specified
levels of the instruments for the endogenous variable (or on the predictors
of the endogenous predictor in an SEM or path model)?
3. I have attempted to do the above with continuous rather than ordinal
models, but seem to be failing at using setx with twosls, though I'm not
sure why. Below are my code and it's output:
md <- as.data.frame(mydata)
formula <- list(
mu1 = synbio.policy ~ republican + male + synbio.affect,
mu2 = synbio.affect ~ republican + male ,
inst = ~ republican + male
)
z.out <- zelig(formula = formula, model = "twosls", data = md)
summary(z.out)
x.out <- setx(z.out, republican = 1, male = 1)
produces the following:
> summary(z.out)
systemfit results
method: 2SLS
N DF SSR detRCov OLS-R2 McElroy-R2
system 2922 2915 1181 0.115 0.079 0.223
N DF SSR MSE RMSE R2 Adj R2
mu1 1461 1457 280 0.192 0.438 0.225 0.224
mu2 1461 1458 901 0.618 0.786 0.022 0.020
The covariance matrix of the residuals
mu1 mu2
mu1 0.1922 -0.0577
mu2 -0.0577 0.6181
The correlations of the residuals
mu1 mu2
mu1 1.000 -0.168
mu2 -0.168 1.000
2SLS estimates for 'mu1' (equation 1)
Model Formula: synbio.policy ~ republican + male + synbio.affect
Instruments: ~republican + male
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.99e-01 7.89e+04 -7.6e-06 1
republican -3.81e-03 6.14e+03 -6.2e-07 1
male 6.82e-02 3.12e+03 2.2e-05 1
synbio.affect 3.95e-01 2.77e+04 1.4e-05 1
Residual standard error: 0.438 on 1457 degrees of freedom
Number of observations: 1461 Degrees of Freedom: 1457
SSR: 280.072 MSE: 0.192 Root MSE: 0.438
Multiple R-Squared: 0.225 Adjusted R-Squared: 0.224
2SLS estimates for 'mu2' (equation 2)
Model Formula: synbio.affect ~ republican + male
Instruments: ~republican + male
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.8436 0.0317 89.64 < 2e-16 ***
republican -0.2214 0.0449 -4.93 9.1e-07 ***
male 0.1124 0.0412 2.73 0.0065 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.786 on 1458 degrees of freedom
Number of observations: 1461 Degrees of Freedom: 1458
SSR: 901.142 MSE: 0.618 Root MSE: 0.786
Multiple R-Squared: 0.022 Adjusted R-Squared: 0.02
> x.out <- setx(z.out, republican = 1, male = 1)
Error in X[, xtmp] <- Xs[[i]][, xtmp] :
number of items to replace is not a multiple of replacement length
Donald Braman
Associate Professor of Law
The George Washington University Law School
2000 H Street, NW | Washington, DC 20052
tel (202) 994-0572 | fax (202) 994-3377
http://www.law.gwu.edu/Faculty/profile.aspx?id=10123http://research.yale.edu/culturalcognitionhttp://ssrn.com/author=286206
Dear Zelig developers!
I have already complained about the issue of using colnames(model.matrix()) to get the
coefficient names in qi.mixed.R
http://lists.hmdc.harvard.edu/lists/zelig/2008_01/msg00020.html
Recent version of Zelig (3.4.0) again uses
fTermsNames <- colnames(model.matrix(parsefml$fixed, data = D))
which IMHO would be better as
fTermsNames <- dimnames(betas)[[2]]
I noticed the same use for random effects, but I can not suggest the solution, because
I am not sure how "special" random effects are handled, i.e., varying intercept and varying
slopes model etc. Using the model.matrix() just for getting the names of location parameters
in the model surely is not the most efficient way, since model.matrix can be a really fat
memory hog for large datasets.
Lep pozdrav / With regards,
Gregor Gorjanc
----------------------------------------------------------------------
University of Ljubljana PhD student
Biotechnical Faculty www: http://gregor.gorjanc.googlepages.com
Animal Science Department blog: http://ggorjan.blogspot.com
Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si
SI-1230 Domzale fax: +386 (0)1 72 17 888
Slovenia, Europe tel: +386 (0)1 72 17 861
----------------------------------------------------------------------
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
Hi,
Is "ls.mixed" currently an option within Zelig? I have version 3.0-6 (which is incidentally what gets loaded when you source() Zelig even though the website says version 3.4-0 is available), and cannot find ls.mixed under the models currently supported. However, the documentation online suggests that it should be there.
Thanks for your help.
Nirmala
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/