First of all, Happy holidays to the people on this forum!
I have 2 questions concerning structural equation modelling (SEM) using Stata SE 14 on Mac OS 10.13.
The first question is basically "how do I calculate the degree of freedom (DoF) for an SEM model". I am aware that the definition of DoF is:
number of information ( k(k+1/2) where k is the number of variables ) minus number of parameters one wishes to estimate.
However, this formula does not seem to work for my case, where I aim to run a very simple mediation model to test if loneliness mediates the association between stigma and depression in my sample (n=350) using the command:
Code:
sem (lonely -> depress, ) (stigma -> depress, ) (stigma -> lonely, ), nocapslatent
The second question concerns Bootstrap failures. Here I used another data (n=120, no missing value) to test the same mediation effect mentioned above, but as can be seen in my codes below, a measurement component is included so that there are 3 indicators for stigma, which is now represented by a latent variable. I have also adjusted for employment and education level.
Code:
. sem (latentstigma -> gih_m, ) (latentstigma -> lih_r, ) (latentstigma -> lih_atol, ) (latentstigma loneliness employment education -> depression, ) (latentstigma employment education -> loneliness, ), latent(latentih ) nocapslatent vce(bootstrap, reps(10) seed(1234)) (running sem on estimation sample) Bootstrap replications (10) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .x.x..xx.. Structural equation model Number of obs = 120 Log likelihood = -1926.6482 Replications = 6
There has been previous report of bootstrap failure on this forum where the -noisily option is suggested to diagnose the bootstrap execution. I have done so with the following codes:
Code:
program bootsem1, rclass sem (latentstigma -> gih_m, ) (latentstigma -> lih_r, ) (latentstigma -> lih_atol, ) (latentstigma loneliness employment education -> depression, ) (latentstigma employment education-> loneliness, ), latent(latentstigma ) nocapslatent estat teffects, compact mat ind = r(indirect) mat dir = r(direct) mat tot = r(total) return scalar ind = ind[1,2] return scalar dirih = dir[1,2] return scalar dirlonely = dir[1,1] return scalar tot = tot[1,2] end set seed 1234 bootstrap r(ind) r(dirih) r(dirlonely) r(tot), noisily reps(10) : bootsem1
Code:
Convergence not achieved an error occurred when bootstrap executed bootsem1, posting missing values
As mentioned, this dataset has no missing value, I am therefore not sure how this came to be and would very much like to know what you think may have gone wrong.
I hope the above question has been presented clearly and following the correct formats.
Please kindly let me know if I can provide any additional information.
Any and all help is very deeply appreciated. Thank you in advance.
Kai-Yuan
0 Response to Structural equation model (SEM): degree of freedom and bootstrapping
Post a Comment