[R] CFA in R/sem package

Jarrett Byrnes byrnes at msi.ucsb.edu
Fri Apr 10 01:43:42 CEST 2009


Sure, something like that.  Store each model as an element of a list,  
and then use something like

for(i in 1:4){
	indices<-combn(1:4, i)
	for (j in 1:length(indices[1,])){
	  new.model<-combine.models(model.pieces[ indices[,j] ] )
	  #code for analysis....
         }
}

Or, if this doesn't fit your problem exactly, some similar approach.

On Apr 9, 2009, at 4:23 PM, Iuri Gavronski wrote:

> Jarret,
>
> I've donwloaded the zip file and installed, but maybe have lost some
> pre-req check. I have manually installed sna.
>
> Anyway, which would be the approach you suggest? Making (using my
> example) 4 different models, one for each construct, then use
> combine.models and add.to.models to create the 12 models to be
> compared?
>
> Best,
>
> Iuri.
>
> On Thu, Apr 9, 2009 at 8:13 PM, Jarrett Byrnes <byrnes at msi.ucsb.edu>  
> wrote:
>> install.packages("sem-additions",repos="http://R-Forge.R- 
>> project.org")
>>
>> Sorry, it's sem-additions on r-forge.  Not sem.additions, which is  
>> what I
>> had originally called it.  But they won't take . in the name of a  
>> package.
>>
>> On Apr 9, 2009, at 4:07 PM, Iuri Gavronski wrote:
>>
>>> Jarret,
>>>
>>> Look:
>>>>
>>>> install.packages("sem.additions", repos="http://R-Forge.R-project.org 
>>>> ")
>>>
>>> Warning message:
>>> package ‘sem.additions’ is not available
>>>>
>>>
>>> Best,
>>>
>>> Iuri.
>>>
>>> On Thu, Apr 9, 2009 at 3:10 PM, Jarrett Byrnes <byrnes at msi.ucsb.edu>
>>> wrote:
>>>>
>>>> Ivan,
>>>>
>>>> I recently put together the sem.additions package over at R forge  
>>>> in part
>>>> for just such a multiple model problem.  THere are a variety of  
>>>> methods
>>>> that
>>>> make it easy to add/delete links that could be automated with a  
>>>> for loop
>>>> and
>>>> something from the combn package, I think.
>>>>
>>>> http://r-forge.r-project.org/projects/sem-additions/
>>>>
>>>> -Jarrett
>>>>
>>>> On Apr 9, 2009, at 6:39 AM, Iuri Gavronski wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am not sure if R-help is the right forum for my question. If  
>>>>> not,
>>>>> please let me know.
>>>>>
>>>>> I have to do some discriminant validity tests with some  
>>>>> constructs. I
>>>>> am using the method of doing a CFA constraining the correlation  
>>>>> of a
>>>>> pair of the constructs to 1 and comparing the chi-square of this
>>>>> constrained model to the unconstrained model. If the chi-square
>>>>> difference is not significant, then I cannot reject the null
>>>>> hypothesis that the two constructs are equal.
>>>>>
>>>>> Well, if you are going to test, say, 4 constructs (A, B, C, and  
>>>>> D),
>>>>> you will have to have 2*C(4,2) = 12 models to test, 5  
>>>>> constructs, 20
>>>>> models, and so forth. A tedious and error prone process...
>>>>>
>>>>> So far, I have been using AMOS for that shake, given that 1) my
>>>>> university has the license, 2) my other colleagues use it, and  
>>>>> 3) I
>>>>> know it ;)
>>>>>
>>>>> I would like to know if any of you use R, namely the sem  
>>>>> package, for
>>>>> that application and if you can share your thoughts/experiences on
>>>>> using it. I don't thing I would have problems "porting" my  
>>>>> models to
>>>>> R/sem, but I would like to know if there is an optimized process  
>>>>> of
>>>>> doing that tests, without manually coding all the dozens of  
>>>>> models.
>>>>>
>>>>> Best,
>>>>>
>>>>> Iuri.
>>>>>
>>>>> ______________________________________________
>>>>> 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.
>>>>
>>>> ______________________________________________
>>>> 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.
>>>>
>>
>> ______________________________________________
>> 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