Skip to content

"save scores" from sem

2 messages · marKo, John Fox

#
I'm not aware of any routine that those the job, although I think that 
it could be relatively easily done by multiplication the manifest 
variable vector with the estimates for the specific effect.
To make an example:

v1; v2; v3; v4 are manifest variables that loads on one y latent 
variablein a data frame called "A"
the code for the model should be like:
model <-specifymodel(
y -> v1, lam1, NA
y -> v2, lam2, NA
y -> v3, lam3, NA
y -> v4, lam4, NA

After fitting the model with sem

model.sem <- sem(model, data=A)

you should be able to compute the y variable like:
attach(data)
data$y<-v1*lam1+v2*lam2+v3*lam3+v4*lam4 #change the loading name with 
the actual loading (number) or extract them from the objectiveML object 
(they are located in model.sem[[15]])

Note that those loadings are unstandardized and that the resulting 
variable will not be standardized.

Hope it helps

Regards,

Marko



--
Marko Ton?i?
Assistant Researcher
University of Rijeka
Faculty of Humanities and Social Sciences
Department of Psychology
Sveu?ili?na Avenija 4, 51000 Rijeka, Croatia
#
Dear Marko,

I can't quite tell whether this is an original question (as suggested by no "Re:" in the subject field and no text from an earlier message) or an answer to a question already posed (as suggested by the phrasing of the message); if the latter, I apologize for missing the original question.

In any event, see the fscore() function in the sem package (?fscore) for computation of factor scores.

I hope this helps,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

On Mon, 18 Mar 2013 13:21:48 +0100
marKo <mtoncic at ffri.hr> wrote: