Say you have a design that looks like a four group
ANCOVA, but your dependent variable is a 0/1 variable. In such
a case, running a normal ANCOVA is not really appropriate since the variable is
0/1, so instead you use probit. You code the data using dummy
codes (b1 through b3) to indicate the group effect and you have a covariate
(cov1). You then run the probit as shown below
clear input y grp b1 b2 b3 cov1, nolog 0 1 1 0 0 43 1 1 1 0 0 54 0 1 1 0 0 44 0 2 0 1 0 49 1 2 0 1 0 45 1 2 0 1 0 42 0 3 0 0 1 54 1 3 0 0 1 34 1 3 0 0 1 56 0 4 0 0 0 45 0 4 0 0 0 67 1 4 0 0 0 54 end
probit y b1 b2 b3 cov1, nolog
Probit regression Number of obs = 12
LR chi2(4) = 1.48
Prob > chi2 = 0.8300
Log likelihood = -7.5772029 Pseudo R2 = 0.0890
——————————————————————————
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
————-+—————————————————————-
b1 | -.1341121 1.115745 -0.12 0.904 -2.320932 2.052708
b2 | .689892 1.168133 0.59 0.555 -1.599607 2.979391
b3 | .7513844 1.106161 0.68 0.497 -1.416651 2.91942
cov1 | -.0188094 .0544449 -0.35 0.730 -.1255194 .0879006
_cons | .6009771 3.061287 0.20 0.844 -5.399034 6.600989
——————————————————————————
Then, if you want to get predicted probabilities for
each cell, but adjusted for the covariate, you can use the adjust command
below. Note that by(grp)is just giving you the probabilities
for the four levels of grp.
adjust cov1, by(grp) pr ci
The output is shown below, with the predicted
probabilities and the confidence intervals.
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: probit
Variables left as is: b1, b2, b3
Covariate set to mean: cov1 = 48.916667
-------------------------------------------------------------------------------------------------------------
———————————————-
grp | pr lb ub
———-+———————————–
1 | .325193 [.028601 .840207]
2 | .644598 [.125402 .970618]
3 | .667227 [.144304 .97293]
4 | .37482 [.028089 .898211]
———————————————-
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]
The results given above are for when cov1 is held constant at its mean
value of 48.92. What if we wanted to see the adjusted probabilities when cov1 is held
constant at 45 and at 50. This can be accomplished simply by setting the covariate to a given
value using an equal sign as shown below.
adjust cov1=45, by(grp) pr ci
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: probit
Variables left as is: b1, b2, b3
Covariate set to value: cov1 = 45
-------------------------------------------------------------------------------------------------------------
----------------------------------------------
grp | pr lb ub
----------+-----------------------------------
1 | .352137 [.032091 .862538]
2 | .67164 [.149509 .973037]
3 | .69355 [.144947 .980785]
4 | .403056 [.020922 .938728]
----------------------------------------------
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]
adjust cov1=50, by(grp) pr ci
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: probit
Variables left as is: b1, b2, b3
Covariate set to value: cov1 = 50
-------------------------------------------------------------------------------------------------------------
----------------------------------------------
grp | pr lb ub
----------+-----------------------------------
1 | .317891 [.026373 .83886]
2 | .636981 [.115327 .971249]
3 | .659791 [.139594 .97167]
4 | .36712 [.029351 .887135]
----------------------------------------------
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]
By the way, this will work the same way if you are using logit instead of
probit as shown below.
logit y b1 b2 b3 cov1, nolog
Logistic regression Number of obs = 12
LR chi2(4) = 1.47
Prob > chi2 = 0.8313
Log likelihood = -7.5808132 Pseudo R2 = 0.0886
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
b1 | -.2337632 1.867017 -0.13 0.900 -3.893049 3.425523
b2 | 1.108887 1.911031 0.58 0.562 -2.636666 4.854439
b3 | 1.199861 1.809699 0.66 0.507 -2.347084 4.746805
cov1 | -.0290209 .0869278 -0.33 0.738 -.1993962 .1413545
_cons | .9010222 4.897605 0.18 0.854 -8.698107 10.50015
------------------------------------------------------------------------------
adjust cov1, by(grp) pr ci
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: logit
Variables left as is: b1, b2, b3
Covariate set to mean: cov1 = 48.916667
-------------------------------------------------------------------------------------------------------------
----------------------------------------------
grp | pr lb ub
----------+-----------------------------------
1 | .32031 [.039684 .843119]
2 | .643435 [.131805 .955455]
3 | .664024 [.14934 .956989]
4 | .373184 [.042341 .889099]
----------------------------------------------
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]
adjust cov1=45, by(grp) pr ci
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: logit
Variables left as is: b1, b2, b3
Covariate set to value: cov1 = 45
-------------------------------------------------------------------------------------------------------------
----------------------------------------------
grp | pr lb ub
----------+-----------------------------------
1 | .345545 [.044664 .856378]
2 | .669067 [.154548 .957193]
3 | .688892 [.151591 .96484]
4 | .400131 [.034988 .924653]
----------------------------------------------
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]
adjust cov1=50, by(grp) pr ci
-------------------------------------------------------------------------------------------------------------
Dependent variable: y Command: logit
Variables left as is: b1, b2, b3
Covariate set to value: cov1 = 50
-------------------------------------------------------------------------------------------------------------
----------------------------------------------
grp | pr lb ub
----------+-----------------------------------
1 | .313505 [.037237 .843556]
2 | .63619 [.122668 .956275]
3 | .656974 [.144724 .955903]
4 | .365859 [.043598 .879546]
----------------------------------------------
Key: pr = Probability
[lb , ub] = [95% Confidence Interval]