[R] polycor package

John Fox jfox at mcmaster.ca
Fri Nov 16 22:13:47 CET 2012


Dear Laura,

As I explained to you when you wrote to me directly, you're not having trouble with the polycor package, since you have AFAICS successfully computed polychoric correlation among your variables. The error is produced when you call sem(), apparently in the lavaan package (though you don't mention that), and you should address your question to the author of that package (or use an appropriate title line in your r-help posting).

Best,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
	
On Fri, 16 Nov 2012 12:58:03 +0000
 Laura Maria Schwirz <schwirzl at tcd.ie> wrote:
> I am currently working with R's polycor package and I have encountered a
> problem. I tried to follow the steps as outlined in the sem.pdf file where
> a CFA model is run using polychoric correlations. Every time I run the
> command sem(model, data, N=.), I get the following warning message:
> Warning message:
> In if (orthogonal) { :
>   the condition has length > 1 and only the first element will be used
> 
> Below is the code that I am using for my dataset. I also tried to copy and
> paste the code from the sem.pdf file using data from CNES but I still get
> an error message.
> Any help would be much appreciated.
> 
> 
> 
> > germany2009 <- read.dta("StataforR.dta")
> > #attach(germany2009)
> > viewData(germany2009)
> > #
> > hcor <- function(data) hetcor(data, std.err=F, pd=T)$correlations
> > hetcor=hcor(germany2009)
> > hetcor
>                cdupid MERKELLIKE    CDULIKE MERKELPROX    CDUPROX
> cdupid      1.0000000  0.5073577  0.6070514 -0.4064925 -0.4146810
> MERKELLIKE  0.5073577  1.0000000  0.7832340 -0.4405571 -0.4200360
> CDULIKE     0.6070514  0.7832340  1.0000000 -0.4868895 -0.5042006
> MERKELPROX -0.4064925 -0.4405571 -0.4868895  1.0000000  0.8789219
> CDUPROX    -0.4146810 -0.4200360 -0.5042006  0.8789219  1.0000000
> > viewData(hetcor)
> > cdu= ' CDULIKE ~ cdupid + CDUPROX
> +   MERKELLIKE ~ cdupid + MERKELPROX
> +   CDUPROX ~ ~ cdupid
> +   cdupid ~ ~ MERKELPROX
> +   CDUPROX ~ ~ MERKELPROX
> +   MERKELLIKE ~ 1
> +   CDULIKE ~1 '
> > sem.cdu= sem(cdu, hetcor, N=1861, meanstructure=F,fixed.x=F)
> Warning message:
> In if (orthogonal) { :
>   the condition has length > 1 and only the first element will be used
> > sem.cdu= sem(cdu, hetcor,  meanstructure=F,fixed.x=F)
> Warning message:
> In if (orthogonal) { :
>   the condition has length > 1 and only the first element will be used
> > summary(sem.cdu)
> 
> -- 
> Laura Schwirz
> 
> PhD Candidate and IRCHSS Scholar
> Department of Political Science
> Trinity College Dublin
> Dublin 2
> Republic of Ireland
> Email: schwirzl at tcd.ie
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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