Hi, to everyone! I have this problem and I don't know to resolve it.
I have a DATA PANEL database and I would estimate the effects of time (tempomesi) and treatment (TRATTATO, the same during the study) on my dependent variable (ILD). For this reason, I choose to use mixed effects models, with varying-intercept and varying-slope, using this command:
xtmixed ILD tempomesi TRATTATO || subject: tempomesi TRATTATO, mle nolog covariance(unstructure)
Treatment variable does not significative. But, I suppose, that the effect of time is different in two groups and therefore I try to estimate two different models, by treatment variable, in this way:
bysort TRATTATO: xtmixed ILD tempomesi || subject: tempomesi, mle nolog covariance(unstructure)
I have obtained:
----------------------------------------------------------------------------------------------------------------------------------
-> TRATTATO = 0
Mixed-effects ML regression Number of obs = 62
Group variable: subject Number of groups = 27
Obs per group: min = 2
avg = 2.3
max = 6
Wald chi2(1) = 21.66
Log likelihood = -245.84494 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
ILD | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tempomesi | .4656706 .100053 4.65 0.000 .2695703 .6617709
_cons | 20.01422 3.260442 6.14 0.000 13.62387 26.40457
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
subject: Unstructured |
sd(tempom~i) | .2559976 .1101921 .1101141 .5951532
sd(_cons) | 15.76703 2.524862 11.51973 21.5803
corr(tempom~i,_cons) | 1 .0000684 -1 1
-----------------------------+------------------------------------------------
sd(Residual) | 6.931615 .8303102 5.48116 8.765899
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 48.18 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
----------------------------------------------------------------------------------------------------------------------------------
-> TRATTATO = 1
Mixed-effects ML regression Number of obs = 55
Group variable: subject Number of groups = 25
Obs per group: min = 2
avg = 2.2
max = 4
Wald chi2(1) = 3.09
Log likelihood = -219.53361 Prob > chi2 = 0.0787
------------------------------------------------------------------------------
ILD | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tempomesi | .2239693 .1273935 1.76 0.079 -.0257174 .4736559
_cons | 18.23112 3.346141 5.45 0.000 11.6728 24.78943
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
subject: Unstructured |
sd(tempom~i) | .0750234 .0589198 .0160955 .3496951
sd(_cons) | 14.96999 2.525032 10.7559 20.83513
corr(tempom~i,_cons) | .9999789 .0014601 -1 1
-----------------------------+------------------------------------------------
sd(Residual) | 7.842885 1.110046 5.942932 10.35025
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 30.35 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
I will be interested to test differences between regression coefficients (tempomesi|TRATTATO=0)=0.4657 and (tempomesi|TRATTATO=1)=0.2240. Could i do this in STATA?
Thanks
Marco
I have a DATA PANEL database and I would estimate the effects of time (tempomesi) and treatment (TRATTATO, the same during the study) on my dependent variable (ILD). For this reason, I choose to use mixed effects models, with varying-intercept and varying-slope, using this command:
xtmixed ILD tempomesi TRATTATO || subject: tempomesi TRATTATO, mle nolog covariance(unstructure)
Treatment variable does not significative. But, I suppose, that the effect of time is different in two groups and therefore I try to estimate two different models, by treatment variable, in this way:
bysort TRATTATO: xtmixed ILD tempomesi || subject: tempomesi, mle nolog covariance(unstructure)
I have obtained:
----------------------------------------------------------------------------------------------------------------------------------
-> TRATTATO = 0
Mixed-effects ML regression Number of obs = 62
Group variable: subject Number of groups = 27
Obs per group: min = 2
avg = 2.3
max = 6
Wald chi2(1) = 21.66
Log likelihood = -245.84494 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
ILD | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tempomesi | .4656706 .100053 4.65 0.000 .2695703 .6617709
_cons | 20.01422 3.260442 6.14 0.000 13.62387 26.40457
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
subject: Unstructured |
sd(tempom~i) | .2559976 .1101921 .1101141 .5951532
sd(_cons) | 15.76703 2.524862 11.51973 21.5803
corr(tempom~i,_cons) | 1 .0000684 -1 1
-----------------------------+------------------------------------------------
sd(Residual) | 6.931615 .8303102 5.48116 8.765899
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 48.18 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
----------------------------------------------------------------------------------------------------------------------------------
-> TRATTATO = 1
Mixed-effects ML regression Number of obs = 55
Group variable: subject Number of groups = 25
Obs per group: min = 2
avg = 2.2
max = 4
Wald chi2(1) = 3.09
Log likelihood = -219.53361 Prob > chi2 = 0.0787
------------------------------------------------------------------------------
ILD | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tempomesi | .2239693 .1273935 1.76 0.079 -.0257174 .4736559
_cons | 18.23112 3.346141 5.45 0.000 11.6728 24.78943
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
subject: Unstructured |
sd(tempom~i) | .0750234 .0589198 .0160955 .3496951
sd(_cons) | 14.96999 2.525032 10.7559 20.83513
corr(tempom~i,_cons) | .9999789 .0014601 -1 1
-----------------------------+------------------------------------------------
sd(Residual) | 7.842885 1.110046 5.942932 10.35025
------------------------------------------------------------------------------
LR test vs. linear regression: chi2(3) = 30.35 Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
I will be interested to test differences between regression coefficients (tempomesi|TRATTATO=0)=0.4657 and (tempomesi|TRATTATO=1)=0.2240. Could i do this in STATA?
Thanks
Marco
Comment