Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Prediction for fractional logit


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Prediction for fractional logit
Date   Tue, 31 May 2011 13:42:16 +0100

If you insist on using the -xb- option with -predict-, that is what
you get! So, just go for the default.

Nick

On Tue, May 31, 2011 at 1:33 PM, S N <[email protected]> wrote:
> Nick and Maarten,
>
> I am pasting the code and the results below.  Thanks. Shonda
>
>
>  Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>     prop_gra |        53    .5790939    .4135732          0          1
>    prop_obc |        54     .160307    .2915177          0          1
>      prop_p1 |        54    .2106382    .2555498          0   .9690722
>          land1 |        54    .4508955    .3359333          0          1
>          land2 |        54    .1073159    .1590588          0   .7647059
>  prop_cash |        53     16.5283    24.05011          0         80
> estdc_land1 |        54    .1926632    .3186031          0   .9230769
>
> estd_ext |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>          0 |         36       65.45       65.45
>          1 |         19       34.55      100.00
> ------------+-----------------------------------
>
>  estd_comm |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>          0 |         32       58.18       58.18
>          1 |         23       41.82      100.00
> ------------+-----------------------------------
>
>
> prop_obc, prop_p1, prop_land1, prop_land2  are all proportions
> themselves. estd_ext, estd_comm, d are dummies, estdc_land1 is an
> interaction term between prop_land1 and estd_comm (so interaction with
> a dummy and a proportion).
>
> ****
>
> glm prop_gra prop_obc prop_p1 prop_land1 prop_land2 prop_cash estd_ext
> estd_comm estdc_land1 d, family (binomial) link (logit)  nolog
>
>
> Generalized linear models                          No. of obs      =        52
> Optimization     : ML                                    Residual df
>  =        42
>
> Scale parameter =         1
> Deviance         =  24.98012225                    (1/df) Deviance =  .5947648
> Pearson          =  25.64304946                    (1/df) Pearson  =  .6105488
>
> Variance function: V(u) = u*(1-u/1)                [Binomial]
> Link function    : g(u) = ln(u/(1-u))                  [Logit]
>
>
> AIC             =   1.20732
> Log likelihood   = -21.39033265                    BIC             = -140.9721
>
> ------------------------------------------------------------------------------
>             |                 OIM
>   prop_gra |      Coef.           Std. Err.      z    P>|z|     [95%
> Conf. Interval]
> -------------+----------------------------------------------------------------
>    prop_obc |    1.20795   1.521787     0.79   0.427    -1.774697    4.190597
>      prop_p1 |   2.271956   1.642525     1.38   0.167     -.947333    5.491246
>  prop_land1 |   1.152989   1.597026     0.72   0.470    -1.977125    4.283103
>  prop_land2 |   1.688074   2.455906     0.69   0.492    -3.125414    6.501561
>  prop_cash |   .0509537   .0253546     2.01   0.044     .0012596    .1006478
>     estd_ext |   1.498499     1.0195     1.47   0.142    -.4996845    3.496682
>  estd_comm |   2.725557   1.472281     1.85   0.064    -.1600611    5.611175
> estdc_land1 |  -3.777789   2.618245    -1.44   0.149    -8.909454    1.353876
>                 d |  -.7853135   .9559989    -0.82   0.411
> -2.659037     1.08841
>          _cons |  -2.317875    1.36365    -1.70   0.089    -4.990581
>  .3548302
>
> ****
> predict gra_pred, xb
>
> *****
> summarize gra_pred
>
>    Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>    gra_pred |        52    .5611184    1.595445   -2.67838   3.891145
>
> *******
>
>
> On Tue, May 31, 2011 at 8:09 AM, Nick Cox <[email protected]> wrote:
>> I agree with your implication that this should not happen. Please tell
>> us more about what you did, including exact -glm- and -predict-
>> commands and -summarize- results for all variables in the model.
>>
>> Nick
>>
>> On Tue, May 31, 2011 at 1:04 PM, S N <[email protected]> wrote:
>>
>>> I am using glm in combination with the link(logit) family(binomial)
>>> robust options to estimate proportion [0,1] of households engaged in a
>>> specific activity. However, the predict command thereafter provides me
>>> with predicted values that takes the values outside [0,1]. What could
>>> I be doing wrong?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index