#delimit;
probit smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic, r
scalar x0=_b[smkban]*0 /*there is no ban*/
+ _b[female]* .5637
+ _b[age]* 38.6932
+ _b[age_squared]* 1643.893
+ _b[hsdrop]* .0912
+ _b[hsgrad]* .3266
+ _b[colsome]*.2802
+ _b[colgrad]* .1972
+ _b[black]*.0769
+ _b[hispanic]*.1134
+ _b[_cons];
scalar x1= x0+ _b[smkban]*1;
dis "Probability for no smoking ban at means ="normprob(x0);
dis "Probability for smoking ban at means ="normprob(x1);
dis "Difference in probabilities ="normprob(x1)-normprob(x0);
#delimit cr
Hello everyone, thanks in advance for you help, I am trying to compute this but I'm getting the error "option scalar not allowed" when i try to compute scalar x1
I really have no clue of what could be the possible error as i computed the same lines for a logit regression and they are exaclty the same and everything is working fine.
I will copy the working logit code too:
#delimit ;
summarize smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic;
logit smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic, r;
scalar w0= _b[smkban]*0 /*there is no ban*/
+ _b[female]* .5637
+ _b[age]* 38.6932
+ _b[age_squared]* 1643.893
+ _b[hsdrop]* .0912
+ _b[hsgrad]* .3266
+ _b[colsome]*.2802
+ _b[colgrad]* .1972
+ _b[black]*.0769
+ _b[hispanic]*.1134
+ _b[_cons];
scalar w1= w0+ _b[smkban]*1;
dis "Probability for no smoking ban at means =" 1/(1+exp(-w0));
dis "Probability for smoking ban at means =" 1/(1+exp(-w1));
dis "Difference in probabilities =" 1/(1+exp(-w1))-1/(1+exp(-w0));
#delimit cr
probit smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic, r
scalar x0=_b[smkban]*0 /*there is no ban*/
+ _b[female]* .5637
+ _b[age]* 38.6932
+ _b[age_squared]* 1643.893
+ _b[hsdrop]* .0912
+ _b[hsgrad]* .3266
+ _b[colsome]*.2802
+ _b[colgrad]* .1972
+ _b[black]*.0769
+ _b[hispanic]*.1134
+ _b[_cons];
scalar x1= x0+ _b[smkban]*1;
dis "Probability for no smoking ban at means ="normprob(x0);
dis "Probability for smoking ban at means ="normprob(x1);
dis "Difference in probabilities ="normprob(x1)-normprob(x0);
#delimit cr
Hello everyone, thanks in advance for you help, I am trying to compute this but I'm getting the error "option scalar not allowed" when i try to compute scalar x1
I really have no clue of what could be the possible error as i computed the same lines for a logit regression and they are exaclty the same and everything is working fine.
I will copy the working logit code too:
#delimit ;
summarize smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic;
logit smoker smkban female age age_squared hsdrop hsgrad colsome colgrad black hispanic, r;
scalar w0= _b[smkban]*0 /*there is no ban*/
+ _b[female]* .5637
+ _b[age]* 38.6932
+ _b[age_squared]* 1643.893
+ _b[hsdrop]* .0912
+ _b[hsgrad]* .3266
+ _b[colsome]*.2802
+ _b[colgrad]* .1972
+ _b[black]*.0769
+ _b[hispanic]*.1134
+ _b[_cons];
scalar w1= w0+ _b[smkban]*1;
dis "Probability for no smoking ban at means =" 1/(1+exp(-w0));
dis "Probability for smoking ban at means =" 1/(1+exp(-w1));
dis "Difference in probabilities =" 1/(1+exp(-w1))-1/(1+exp(-w0));
#delimit cr
Comment