map: list giving how the latent variables map onto the observed variables
params: parameter numbers
idvar: names of the variables used to identify the factors
exo.names: names of the exogenous covariates
intercept: logical. Whether to include freely esimated intercepts
Returns
Object of class 'dynrMeasurement'
Details
The default pattern for 'idvar' is to fix the first factor loading for each factor to one. The variable names listed in 'idvar' have their factor loadings fixed to one. However, if the names of the latent variables are used for 'idvar', then all the factor loadings will be freely estimated and you should fix the factor variances in the noise part of the model (e.g. prep.noise).
This function does not have the full set of features possible in the dynr package. In particular, it does not have any regime-swtiching. Covariates can be included with the exo.names argument, but all covariate effects are freely estimated and the starting values are all zero. Likewise, intercepts can be included with the intercept
logical argument, but all intercept terms are freely estimated with zero as the starting value. For complete functionality use prep.measurement.
Examples
#Single factor model with one latent variable fixing first loadingprep.loadings(list(eta1=paste0('y',1:4)), paste0("lambda_",2:4))#Single factor model with one latent variable fixing the fourth loadingprep.loadings(list(eta1=paste0('y',1:4)), paste0("lambda_",1:3), idvar='y4')#Single factor model with one latent variable freeing all loadingsprep.loadings(list(eta1=paste0('y',1:4)), paste0("lambda_",1:4), idvar='eta1')#Single factor model with one latent variable fixing first loading# and freely estimated interceptprep.loadings(list(eta1=paste0('y',1:4)), paste0("lambda_",2:4), intercept=TRUE)#Single factor model with one latent variable fixing first loading# and freely estimated covariate effects for u1 and u2prep.loadings(list(eta1=paste0('y',1:4)), paste0("lambda_",2:4), exo.names=paste0('u',1:2))# Two factor model with simple structureprep.loadings(list(eta1=paste0('y',1:4), eta2=paste0('y',5:7)),paste0("lambda_", c(2:4,6:7)))#Two factor model with repeated use of a free parameterprep.loadings(list(eta1=paste0('y',1:4), eta2=paste0('y',5:8)),paste0("lambda_", c(2:4,6:7,4)))#Two factor model with a cross loadingprep.loadings(list(eta1=paste0('y',1:4), eta2=c('y5','y2','y6')),paste0("lambda_", c("21","31","41","22","62")))