-----Original Message-----
From: Suzy <scott_788(a)wowway.com>
Date: Fri, 15 Jul 2005 12:18:23
To:king@harvard.edu
Subject: Need coding for generating a regression model stratified by a dichotomous
indvar. using the qsim command
Dear Sir, I am using Clarify for the first time and trying to create 2 separate regression
models, stratified by the newrace2mis (0,1) variable. Based on the documentation, it looks
like the following commands should have worked (see below), but they do not, as you can
see. I'm certain that I've misunderstood the instructions. Could you please
e-mail me and provide information/coding on how to obtain a stratified regression model.
Thank you very much for your help in this matter.
Best regards,
Suzy
tab newrace2mis
newrace2mis | Freq. Percent Cum.
------------+-----------------------------------
0 | 135 11.79 11.79
1 | 1,010 88.21 100.00
------------+-----------------------------------
Total | 1,145 100.00
qsim, c("regr ln_pbb i.c_n_demo i.age_cat build_yr ") setx2 (newrace2mis 0)
i.c_n_demo _Ic_n_demo_0-2 (naturally coded; _Ic_n_demo_0 omitted)
i.age_cat _Iage_cat_0-2 (naturally coded; _Iage_cat_0 omitted)
Source | SS df MS Number of obs = 1196
-------------+------------------------------ F( 5, 1190) = 10.69
Model | 23.5701727 5 4.71403453 Prob > F = 0.0000
Residual | 524.617798 1190 .440855292 R-squared = 0.0430
-------------+------------------------------ Adj R-squared = 0.0390
Total | 548.18797 1195 .458734703 Root MSE = .66397
------------------------------------------------------------------------------
ln_pbb | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_Ic_n_demo_1 | .0687954 .0459445 1.50 0.135 -.0213459 .1589366
_Ic_n_demo_2 | .308582 .1073778 2.87 0.004 .097911 .5192529
_Iage_cat_1 | .3598331 .065714 5.48 0.000 .2309049 .4887613
_Iage_cat_2 | .2462407 .0643693 3.83 0.000 .1199506 .3725307
build_yr | -.0037854 .0009719 -3.89 0.000 -.0056923 -.0018785
_cons | 8.665999 1.859763 4.66 0.000 5.017219 12.31478
------------------------------------------------------------------------------
Simulating main parameters. Please wait....
% of simulations completed: 16% 33% 50% 66% 83% 100%
Simulating sigma-squared. Please wait
Number of simulations : 1000
Names of new variables : b1 b2 b3 b4 b5 b6 b7
regr ln_pbb i.c_n_demo i.age_cat build_yr
newrace2mis was not an explanatory variable in the last estimated model.
r(198);
qsim, c("regr ln_pbb i.c_n_demo i.age_cat build_yr newrace2mis ") setx2(
newrace2mis 0)
i.c_n_demo _Ic_n_demo_0-2 (naturally coded; _Ic_n_demo_0 omitted)
i.age_cat _Iage_cat_0-2 (naturally coded; _Iage_cat_0 omitted)
Source | SS df MS Number of obs = 1145
-------------+------------------------------ F( 6, 1138) = 11.71
Model | 30.8684545 6 5.14474242 Prob > F = 0.0000
Residual | 500.143081 1138 .439493041 R-squared = 0.0581
-------------+------------------------------ Adj R-squared = 0.0532
Total | 531.011536 1144 .464170923 Root MSE = .66294
------------------------------------------------------------------------------
ln_pbb | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_Ic_n_demo_1 | .0474644 .0468849 1.01 0.312 -.0445262 .139455
_Ic_n_demo_2 | .2820453 .1073858 2.63 0.009 .0713489 .4927416
_Iage_cat_1 | .3398308 .0673856 5.04 0.000 .2076169 .4720447
_Iage_cat_2 | .2208686 .0661092 3.34 0.001 .091159 .3505783
build_yr | -.0037124 .0009893 -3.75 0.000 -.0056535 -.0017713
newrace2mis | .2759708 .0609784 4.53 0.000 .1563281 .3956135
_cons | 8.317301 1.894719 4.39 0.000 4.599767 12.03484
------------------------------------------------------------------------------
. qsim, c("regr ln_pbb i.c_n_demo i.age_cat build_yr newrace2mis ") setx2(
newrace2mis 1)
i.c_n_demo _Ic_n_demo_0-2 (naturally coded; _Ic_n_demo_0 omitted)
i.age_cat _Iage_cat_0-2 (naturally coded; _Iage_cat_0 omitted)
Source | SS df MS Number of obs = 1145
-------------+------------------------------ F( 6, 1138) = 11.71
Model | 30.8684545 6 5.14474242 Prob > F = 0.0000
Residual | 500.143081 1138 .439493041 R-squared = 0.0581
-------------+------------------------------ Adj R-squared = 0.0532
Total | 531.011536 1144 .464170923 Root MSE = .66294
------------------------------------------------------------------------------
ln_pbb | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_Ic_n_demo_1 | .0474644 .0468849 1.01 0.312 -.0445262 .139455
_Ic_n_demo_2 | .2820453 .1073858 2.63 0.009 .0713489 .4927416
_Iage_cat_1 | .3398308 .0673856 5.04 0.000 .2076169 .4720447
_Iage_cat_2 | .2208686 .0661092 3.34 0.001 .091159 .3505783
build_yr | -.0037124 .0009893 -3.75 0.000 -.0056535 -.0017713
newrace2mis | .2759708 .0609784 4.53 0.000 .1563281 .3956135
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.hmdc.harvard.edu/?info=clarify