Dear all,
I am having some doubts on my regression model. I am exploring the effect of two dummy variables ("fk1n" 3 factors (1-2-3), and "ctq_total_80p" 2 factors (1-2)) on the continuous "CAPE_NEG" variable (outcome). I also want to explore the effect of the interaction between both variables on the outcome. In all the analyses I include Age, Sex and Sample as covariables.
For the main effects I have had no problem:
xi: regress CAPE_NEG i.fk1n Sex Age Sample, beta
i.fk1n _Ifk1n_1-3 (naturally coded; _Ifk1n_1 omitted)
Source | SS df MS Number of obs = 773
-------------+------------------------------ F( 5, 767) = 1.67
Model | 235.003861 5 47.0007722 Prob > F = 0.1386
Residual | 21541.9172 767 28.0859416 R-squared = 0.0108
-------------+------------------------------ Adj R-squared = 0.0043
Total | 21776.9211 772 28.208447 Root MSE = 5.2996
------------------------------------------------------------------------------
CAPE_NEG | Coef. Std. Err. t P>|t| Beta
-------------+----------------------------------------------------------------
_Ifk1n_2 | .2063414 .4034761 0.51 0.609 .0192905
_Ifk1n_3 | .1708133 .6607577 0.26 0.796 .0097483
Sex | -.3892154 .4649464 -0.84 0.403 -.0308724
Age | -.1064209 .0464872 -2.29 0.022 -.0826285
Sample | .6120988 .4159441 1.47 0.142 .0542749
_cons | 10.80678 1.237075 8.74 0.000 .
------------------------------------------------------------------------------
I used the xi command to later see the effect between fk1n 2 and 3.
To explore the interaction effects between fk1n and ctq_total_80p on CAPE_NEG, I first run the regression including the interaction term as "i.ctq_total_80p##i.fk1n", however, with this I could not see the effect of all the interaction factors. So I calculated a new variable with the interaction:
tab fk1n ctq_total_80p, nolabel
FKBP5_1_rs | CTQ_TOTAL_80p
3800373 | 1 2 | Total
-----------+----------------------+----------
1 | 289 68 | 357
2 | 265 77 | 342
3 | 62 16 | 78
-----------+----------------------+----------
Total | 616 161 | 777
. tab totalxfk1n
totalxfk1n | Freq. Percent Cum.
------------+-----------------------------------
11 | 289 37.19 37.19
12 | 265 34.11 71.30
13 | 62 7.98 79.28
21 | 68 8.75 88.03
22 | 77 9.91 97.94
23 | 16 2.06 100.00
------------+-----------------------------------
Total | 777 100.00
and then added it to the regression model. However, when I include the interaction term on the model (keeping the main effects) it omits some factors, because of collinearity, as shown below. How can I do this? I need to include also the main effects... Should I do it in a different way?
xi: regress CAPE_NEG i.ctq_total_80p i.fk1n i.totalxfk1n Sex Age Sample, beta
i.ctq_total_80p _Ictq_total_1-2 (naturally coded; _Ictq_total_2 omitted)
i.fk1n _Ifk1n_1-3 (naturally coded; _Ifk1n_3 omitted)
i.totalxfk1n _Itotalxfk1_11-23 (naturally coded; _Itotalxfk1_11 omitted)
note: _Ifk1n_2 omitted because of collinearity
note: _Itotalxfk1_13 omitted because of collinearity
note: _Itotalxfk1_21 omitted because of collinearity
Source | SS df MS Number of obs = 772
-------------+------------------------------ F( 8, 763) = 4.98
Model | 1078.82213 8 134.852766 Prob > F = 0.0000
Residual | 20680.3009 763 27.1039331 R-squared = 0.0496
-------------+------------------------------ Adj R-squared = 0.0396
Total | 21759.1231 771 28.2219495 Root MSE = 5.2061
--------------------------------------------------------------------------------
CAPE_NEG | Coef. Std. Err. t P>|t| Beta
---------------+----------------------------------------------------------------
_Ictq_total_1 | -3.43665 .7063009 -4.87 0.000 -.2629902
_Ifk1n_1 | -.6494848 .7304092 -0.89 0.374 -.0609708
_Ifk1n_2 | 0 (omitted) 0
_Itotalxfk1_12 | -.2175991 .7355693 -0.30 0.767 -.0194072
_Itotalxfk1_13 | 0 (omitted) 0
_Itotalxfk1_21 | 0 (omitted) 0
_Itotalxfk1_22 | -1.832638 1.13418 -1.62 0.107 -.1034392
_Itotalxfk1_23 | -2.420919 1.620644 -1.49 0.136 -.0649639
Sex | -.3537958 .4569318 -0.77 0.439 -.028069
Age | -.1329175 .0459178 -2.89 0.004 -.103241
Sample | .4442104 .4101547 1.08 0.279 .0393917
_cons | 14.99289 1.567061 9.57 0.000 .
--------------------------------------------------------------------------------
Hope I have explained myself clearly.
Thanks in advance.
With kind regards,
Marta.
I am having some doubts on my regression model. I am exploring the effect of two dummy variables ("fk1n" 3 factors (1-2-3), and "ctq_total_80p" 2 factors (1-2)) on the continuous "CAPE_NEG" variable (outcome). I also want to explore the effect of the interaction between both variables on the outcome. In all the analyses I include Age, Sex and Sample as covariables.
For the main effects I have had no problem:
xi: regress CAPE_NEG i.fk1n Sex Age Sample, beta
i.fk1n _Ifk1n_1-3 (naturally coded; _Ifk1n_1 omitted)
Source | SS df MS Number of obs = 773
-------------+------------------------------ F( 5, 767) = 1.67
Model | 235.003861 5 47.0007722 Prob > F = 0.1386
Residual | 21541.9172 767 28.0859416 R-squared = 0.0108
-------------+------------------------------ Adj R-squared = 0.0043
Total | 21776.9211 772 28.208447 Root MSE = 5.2996
------------------------------------------------------------------------------
CAPE_NEG | Coef. Std. Err. t P>|t| Beta
-------------+----------------------------------------------------------------
_Ifk1n_2 | .2063414 .4034761 0.51 0.609 .0192905
_Ifk1n_3 | .1708133 .6607577 0.26 0.796 .0097483
Sex | -.3892154 .4649464 -0.84 0.403 -.0308724
Age | -.1064209 .0464872 -2.29 0.022 -.0826285
Sample | .6120988 .4159441 1.47 0.142 .0542749
_cons | 10.80678 1.237075 8.74 0.000 .
------------------------------------------------------------------------------
I used the xi command to later see the effect between fk1n 2 and 3.
To explore the interaction effects between fk1n and ctq_total_80p on CAPE_NEG, I first run the regression including the interaction term as "i.ctq_total_80p##i.fk1n", however, with this I could not see the effect of all the interaction factors. So I calculated a new variable with the interaction:
tab fk1n ctq_total_80p, nolabel
FKBP5_1_rs | CTQ_TOTAL_80p
3800373 | 1 2 | Total
-----------+----------------------+----------
1 | 289 68 | 357
2 | 265 77 | 342
3 | 62 16 | 78
-----------+----------------------+----------
Total | 616 161 | 777
. tab totalxfk1n
totalxfk1n | Freq. Percent Cum.
------------+-----------------------------------
11 | 289 37.19 37.19
12 | 265 34.11 71.30
13 | 62 7.98 79.28
21 | 68 8.75 88.03
22 | 77 9.91 97.94
23 | 16 2.06 100.00
------------+-----------------------------------
Total | 777 100.00
and then added it to the regression model. However, when I include the interaction term on the model (keeping the main effects) it omits some factors, because of collinearity, as shown below. How can I do this? I need to include also the main effects... Should I do it in a different way?
xi: regress CAPE_NEG i.ctq_total_80p i.fk1n i.totalxfk1n Sex Age Sample, beta
i.ctq_total_80p _Ictq_total_1-2 (naturally coded; _Ictq_total_2 omitted)
i.fk1n _Ifk1n_1-3 (naturally coded; _Ifk1n_3 omitted)
i.totalxfk1n _Itotalxfk1_11-23 (naturally coded; _Itotalxfk1_11 omitted)
note: _Ifk1n_2 omitted because of collinearity
note: _Itotalxfk1_13 omitted because of collinearity
note: _Itotalxfk1_21 omitted because of collinearity
Source | SS df MS Number of obs = 772
-------------+------------------------------ F( 8, 763) = 4.98
Model | 1078.82213 8 134.852766 Prob > F = 0.0000
Residual | 20680.3009 763 27.1039331 R-squared = 0.0496
-------------+------------------------------ Adj R-squared = 0.0396
Total | 21759.1231 771 28.2219495 Root MSE = 5.2061
--------------------------------------------------------------------------------
CAPE_NEG | Coef. Std. Err. t P>|t| Beta
---------------+----------------------------------------------------------------
_Ictq_total_1 | -3.43665 .7063009 -4.87 0.000 -.2629902
_Ifk1n_1 | -.6494848 .7304092 -0.89 0.374 -.0609708
_Ifk1n_2 | 0 (omitted) 0
_Itotalxfk1_12 | -.2175991 .7355693 -0.30 0.767 -.0194072
_Itotalxfk1_13 | 0 (omitted) 0
_Itotalxfk1_21 | 0 (omitted) 0
_Itotalxfk1_22 | -1.832638 1.13418 -1.62 0.107 -.1034392
_Itotalxfk1_23 | -2.420919 1.620644 -1.49 0.136 -.0649639
Sex | -.3537958 .4569318 -0.77 0.439 -.028069
Age | -.1329175 .0459178 -2.89 0.004 -.103241
Sample | .4442104 .4101547 1.08 0.279 .0393917
_cons | 14.99289 1.567061 9.57 0.000 .
--------------------------------------------------------------------------------
Hope I have explained myself clearly.
Thanks in advance.
With kind regards,
Marta.
Comment