[R] Dealing with large nominal predictor in sem package

John Fox jfox at mcmaster.ca
Tue Apr 10 03:55:30 CEST 2007


Dear adschai,

> -----Original Message-----
> From: adschai at optonline.net [mailto:adschai at optonline.net] 
> Sent: Monday, April 09, 2007 8:30 PM
> To: John Fox; r-help at stat.math.ethz.ch
> Subject: Re: RE: [R] Dealing with large nominal predictor in 
> sem package
> 
> Hi John,
> 
> Additional two questions on this sem package:
> (1) The tsls is based on maximum likelihood or OLS?

Neither; it does two-stage least-squares (2SLS).

> (2) I am trying to find goodness of fit for the result of 
> tsls. Somehow, I don't see it in the documentation. Would you 
> please provide some examples? 

I'm not sure what you mean by goodness of fit. If you have in mind an
R^2-like measure; you can always use 1 -
error-variance/variance-of-endogenous-variable, but this is not guaranteed
to be positive.

> (3) If I would like to diagnostic of model selection, says 
> use AIC criteria, it is a bit unclear for me how I can apply 
> this on structural equation model as it is composed of 
> multiple equations rather than one. And is there any 
> functionality in sem that does this? 

Since there's no likelihood for 2SLS estimation, I don't see how you could
get an AIC. On the other hand, sem() fits by full-information
maximum-likelihood (FIML). It prints out the BIC; you could compute the AIC
if you liked.

John

> Any help would be really appreciated. Thank you.
> 
> - adschai
> 
> ----- Original Message -----
> From: John Fox
> Date: Monday, April 9, 2007 8:04 am
> Subject: RE: [R] Dealing with large nominal predictor in sem package
> To: adschai at optonline.net
> Cc: r-help at stat.math.ethz.ch
> 
> > Dear adschai,
> > 
> > It's not possible to know from your description exactly what you're 
> > doing, but perhaps the following will help:
> > 
> > (1) I presume that your nominal variable is exogenous, 
> since otherwise 
> > it wouldn't be sensible to use 2SLS.
> > 
> > (2) You don't have to make your own dummy regressors for a nominal 
> > variable; just represent it in the model as a factor as you would, 
> > e.g., in lm().
> > 
> > (3) Do you have at least as many instrumental variables 
> (including the 
> > dummy
> > regressors) as there are structural coefficients to 
> estimate? If not, 
> > the structural equation is underidentified, which will produce the 
> > error that you've encountered.
> > 
> > I hope this helps,
> > John
> > 
> > --------------------------------
> > John Fox
> > Department of Sociology
> > McMaster University
> > Hamilton, Ontario
> > Canada L8S 4M4
> > 905-525-9140x23604
> > http://socserv.mcmaster.ca/jfox
> > --------------------------------
> > 
> > > -----Original Message-----
> > > From: r-help-bounces at stat.math.ethz.ch 
> > > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> > > adschai at optonline.net
> > > Sent: Sunday, April 08, 2007 11:07 PM
> > > To: r-help at stat.math.ethz.ch
> > > Subject: [R] Dealing with large nominal predictor in sem package
> > > 
> > > Hi,
> > > 
> > > I am using tsls function from sem package to estimate a 
> model which 
> > > includes large number of data. Among its predictors, it has a 
> > > nominal data which has about 10 possible values. So I expand this 
> > > parameter into 9-binary-value predictors with the coefficient of 
> > > base value equals 0. I also have another continuous predictor.
> > > 
> > > The problem is that, whenever I run the tsls, I will get 
> 'System is 
> > > computationally singular' error all the time. I'm 
> wondering if there 
> > > is anyway that I can overcome this problem? Please kindly 
> suggest. 
> > > Thank you so much in advance.
> > > 
> > > - adschai
> > > 
> > > [[alternative HTML version deleted]]
> > > 
> > > ______________________________________________
> > > R-help at stat.math.ethz.ch mailing list 
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > > 
> > 
> > 
> > 
>



More information about the R-help mailing list