hsemfit {hsem} | R Documentation |
Fitting Hierarchical Structural Equation Models using h-likelihood Approach
Description
The hsemfit is used to fit a hierarchical structural equation models (HSEMs) allowing different models for multivariate reponse variables. A variety of distributions and link functions for both response and the random effects are allowed. To call the fitting function hsemfit, models for the mean and dispersion must be specified by hsemmodleing object preferably created by calling the hsemmodeling function.
Usage
hsemfit(RespDist = "gaussian", BinomialDen = NULL,
DataMain, MeanModel,DispersionModel = NULL,
PhiFix = NULL, LamFix = NULL, structure = "correlated",
mord = 0, dord = 1, convergence = 1e-05,
Init_Corr = NULL, EstimateCorrelations = TRUE)
Arguments
RespDist |
The distribution of the response is set by the option |
BinomialDen |
When |
DataMain |
The option |
MeanModel |
For the mean model, this option requries |
DispersionModel |
For the overdispersion model, this option requries |
PhiFix |
The option for overdispersion parameters (phi) to be estimated or maintaned constant.
Specifying defaults such as |
LamFix |
The option for random-effect variance (lambda) to be estimated or maintaned constant.
Specifying defaults such as |
structure |
The option |
mord |
The option |
dord |
The option |
convergence |
Setting this option determines the criterion for convergence, which is computed as the absolute difference between the values of all the estimated parameters in the previous and current iterations. The default criterion is 1e-06. |
Init_Corr |
Setting initial values of correlation (or shared parameters) between random effects |
EstimateCorrelations |
Correlation are estimated or fixed when |
Value
res |
the output class resulted from jointfit_correlated. |
Examples
data(ml2)
MM1<-hsemmodeling(Model="mean",Link="identity",
LinPred=urge~urge1+dep1+(1|id)+(urge1|id)+(dep1|id),
RandDist=c("gaussian","gaussian","gaussian"))
DM1<-hsemmodeling(Model="dispersion",Link = "log",
LinPred=phi~(1|id),RandDist=c("gaussian"))
MM2<-hsemmodeling(Model="mean",Link="identity",
LinPred=dep~urge1+dep1+(1|id)+(urge1|id)+(dep1|id),
RandDist=c("gaussian","gaussian","gaussian"))
DM2<-hsemmodeling(Model="dispersion",Link = "log",
LinPred=phi~(1|id),RandDist=c("gaussian"))
res<-hsemfit(RespDist=c("gaussian","gaussian"),DataMain=list(ml2,ml2),
structure="independent",MeanModel=list(MM1,MM2),
DispersionModel=list(DM1,DM2))