[R] SEM GFI

Fox, John jfox at mcmaster.ca
Thu Jun 2 14:01:15 CEST 2016


Dear Vinay and Burt,

I didn't see Vinay's original posting -- sorry about that.

Vinay: There's still not enough information here to tell why the results are different, and posting in HTML makes the code very hard to read. 

To elaborate slightly: You don't provide the data, so it's not possible to replicate your results. You also don't show the command or results from SAS, so it's not possible to know how the results differ. Your original message seems to imply that the results are identical accept for the value of GFI and one coefficient standard error. That seems unlikely. My guess: you inadvertently fit different models in SAS and sem.

Additionally, you'd probably find it easier, and less error prone, to specify the model in sem() using specifyEquations() rather than specifyModel(), as the message printed by the latter tells you.

I hope this helps,
 John

-----------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
Web: socserv.mcmaster.ca/jfox




> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of VINAY
> KULKARNI via R-help
> Sent: June 1, 2016 1:42 PM
> To: Bert Gunter <bgunter.4567 at gmail.com>
> Cc: r-help at r-project.org
> Subject: Re: [R] SEM GFI
> 
> Hi,
> Please find below the code:
> Thanks,Vinay
> >library(sem) >data1=read.csv("data_1.csv") >corr=cor(data1)
> >model1<-specifyModel()brand1_Pric_ind    ->
> >Val_brand1,lamb1,NADist_brand1       ->
> >Val_brand1,lamb2,NAbrand1_like_me     ->
> >Val_brand1,lamb3,NAbrand2_Def_Drink -
> >   Val_brand1,lamb4,NAbrand2_Like
> >-> brand2_Def_Drink,lamb5,NAbrand2_Pleasure ->
> >brand2_Def_Drink,lamb6,NAbrand1_Like ->
> >brand1_like_me,lamb7,NAbrand1_Love ->
> >brand1_like_me,lamb8,NAbrand1_P4WC ->
> brand1_Like,lamb9,NAbrand1_P4WC
> >-> brand1_Love,lamb10,NAbrand1_Energy ->
> >brand1_P4WC,lamb11,NAbrand1_Different ->
> >brand1_P4WC,lamb12,NAbrand1_Pric_ind <->
> >brand1_Pric_ind,the1,NADist_brand1 <->
> >Dist_brand1,the2,NAbrand1_like_me  <->
> >brand1_like_me,the3,NAbrand2_Def_Drink <->
> >brand2_Def_Drink,the4,NAbrand2_Like <->
> >brand2_Like,the5,NAbrand2_Pleasure <->
> >brand2_Pleasure,the6,NAbrand1_Like <-> brand1_Like,the7,NAbrand1_Love
> ><-> brand1_Love,the8,NAbrand1_P4WC <->
> brand1_P4WC,the9,NAbrand1_Energy
> ><-> brand1_Energy,the10,NAbrand1_Different <->
> >brand1_Different,the11,NAbrand1_like_me  <->
> >brand2_Def_Drink,the12,NAbrand1_Like <->
> brand1_Love,the13,NAVal_brand1
> ><-> Val_brand1,1,NA  > opt <- options(fit.indices = c("GFI", "AGFI",
> >"RMSEA", "NFI", "NNFI", "CFI", "RNI", "IFI", "SRMR", "AIC", "AICc",
> >"BIC", "CAIC")) > sem.model1<-sem(model1,corr,36)
> > summary(sem.model1)
> 
> 
> 
> 
>       From: Bert Gunter <bgunter.4567 at gmail.com>
>  To: VINAY KULKARNI <vinaypkulkarni at yahoo.com>
> Cc: "r-help at r-project.org" <r-help at r-project.org>
>  Sent: Wednesday, 1 June 2016 2:16 AM
>  Subject: Re: [R] SEM GFI
> 
> Probably impossible to answer without your following the posting guide and
> posting your code, etc.
> 
> Cheers,
> 
> Bert
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Tue, May 31, 2016 at 11:28 AM, VINAY KULKARNI via R-help <r-help at r-
> project.org> wrote:
> > Hi,
> > I am exactly replicating the SEM model which was done in SAS using Proc
> Calis in R.
> > Used sem package in R but not getting the GFI as same as in SAS
> > (approximately 15% difference) and also one link is insignificant but in SAS
> am getting significant.
> > Searched through online in different blogs but not able to get the solution.
> > Please let me know what might be the reason.
> > Thanks,Vinay
> >
> >
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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