- Thread starter qim
- Start date

Yes, I could do

xi: logit con *** i.agegrps

The problem is that I am supposed to calculate predicted possibilities and while I can read the normal regression I CANNOT read (I am ashamed to say) the regression when you have the agegrps split up into 3. I can't relate the coefficients to 'con' and especially how to read the Iagegrps_2 which is omitted.

. xi: logit con *** i.agegrps [pw=weight]

i.agegrps _Iagegrps_1-3 (naturally coded; _Iagegrps_2 omitted)

(sum of wgt is 2.2190e+03)

Iteration 0: log pseudolikelihood = -1651.5837

Iteration 1: log pseudolikelihood = -1642.1845

Iteration 2: log pseudolikelihood = -1642.1614

Iteration 3: log pseudolikelihood = -1642.1614

Logistic regression Number of obs = 2756

Wald chi2(3) = 14.33

Prob > chi2 = 0.0025

Log pseudolikelihood = -1642.1614 Pseudo R2 = 0.0057

------------------------------------------------------------------------------

| Robust

con | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

*** | .1102079 .0998779 1.10 0.270 -.0855492 .305965

_Iagegrps_1 | -.1929194 .1292349 -1.49 0.135 -.4462152 .0603765

_Iagegrps_3 | .2774401 .1120542 2.48 0.013 .0578179 .4970622

_cons | -1.103701 .1715891 -6.43 0.000 -1.440009 -.7673924

------------------------------------------------------------------------------

The first independent variable is xes (the other way roun which the forum does not allow!)

Can you help there?

qim

xi: logit con *** i.agegrps

The problem is that I am supposed to calculate predicted possibilities and while I can read the normal regression I CANNOT read (I am ashamed to say) the regression when you have the agegrps split up into 3. I can't relate the coefficients to 'con' and especially how to read the Iagegrps_2 which is omitted.

. xi: logit con *** i.agegrps [pw=weight]

i.agegrps _Iagegrps_1-3 (naturally coded; _Iagegrps_2 omitted)

(sum of wgt is 2.2190e+03)

Iteration 0: log pseudolikelihood = -1651.5837

Iteration 1: log pseudolikelihood = -1642.1845

Iteration 2: log pseudolikelihood = -1642.1614

Iteration 3: log pseudolikelihood = -1642.1614

Logistic regression Number of obs = 2756

Wald chi2(3) = 14.33

Prob > chi2 = 0.0025

Log pseudolikelihood = -1642.1614 Pseudo R2 = 0.0057

------------------------------------------------------------------------------

| Robust

con | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

*** | .1102079 .0998779 1.10 0.270 -.0855492 .305965

_Iagegrps_1 | -.1929194 .1292349 -1.49 0.135 -.4462152 .0603765

_Iagegrps_3 | .2774401 .1120542 2.48 0.013 .0578179 .4970622

_cons | -1.103701 .1715891 -6.43 0.000 -1.440009 -.7673924

------------------------------------------------------------------------------

The first independent variable is xes (the other way roun which the forum does not allow!)

Can you help there?

qim

Last edited:

To predict expected values of the dependent variable you should just be able to use the predict command with appropriate options--check the manual for this.

generate prob = exp(-1.652666+0.01183*agegrps)/ (1 + exp(-1.652666+0.01183*agegrps))

If I have several (3) agegrps which coefficient am I going to use to generate the rob? Or do I need to generate more than one? if I do that it does not make sense (to me).

Or do I keep adding the various agegroups before dividing by the denominator?

Help...

qim

gen agegrp1=0

replace agegrp1=1 if agegrps==1 (I forget the proper syntax for "else" in STATA but you get the point)

gen agegrp2=0

replace agegrp2=1 if agegrps==2

gen agegrp3=0

replace agegrp3=1 if agegrps==3

Then you run:

logit con sx agegrp1 agegrp3

Then predict. The predict command would do this but if you want to do it manually you can just take the data for one observation and put it in the estimated equation--you'll include both agegrp1 and agegrp3 since it'll just zero out if eith value is 0, and if both are the effect is captured in the constant.

I'm happy to keep this up, but it seems like you're unclear on what exactly a logit regression will tell you, why you put certain variables in, etc. I'd suggest you read up on the basics of linear regression before worrying too much about logit--the principles of multicollinearity, dummy variables, predicted values, etc will translate well.

Thanks AtlasFrysmith

I'm sorry, you're right. I haven't got a clue. I am not a statistics student, but somehow I was lumped with this and have to finish it tonight. I have read as much as I could but 1 week is not enough.

Somehow I need to get from xi: command ... i.agegrp to generate prob (manually). from the notes there was no splitting into 3 variables, although I am sure tha is the right, best way to do it.

Anyway, I'm now editing this message to say thank you very much for your help, and that the assignment has now been delivered by e-mail. So, that will be the end of staistics for the rest of my life!

Many thanks

qim

I'm sorry, you're right. I haven't got a clue. I am not a statistics student, but somehow I was lumped with this and have to finish it tonight. I have read as much as I could but 1 week is not enough.

Somehow I need to get from xi: command ... i.agegrp to generate prob (manually). from the notes there was no splitting into 3 variables, although I am sure tha is the right, best way to do it.

Anyway, I'm now editing this message to say thank you very much for your help, and that the assignment has now been delivered by e-mail. So, that will be the end of staistics for the rest of my life!

Many thanks

qim

Last edited: