ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Trabajo lohit


Enviado por   •  18 de Agosto de 2017  •  Documentos de Investigación  •  22.339 Palabras (90 Páginas)  •  196 Visitas

Página 1 de 90

. //  MODELOS PARA VARIABLES DEPENDIENTES ORDINALES EN STATA

.

. //  Regression Models for Categorical Dependent Variables - 2nd Edition

. //  Chapter 5 - Models for Ordinal Outcomes

. //  Long and Freese – 27jul2005

. //  Comentarios en español: Javier Aparicio - 3nov2008

. //  (Ver DO FILE al final de este documento)

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

       log:  D:\MyDocs\Metodos08\Long&FreeseSpost9\ch5_ordinal.log

  log type:  text

 opened on:  30 Nov 2008, 20:45:08

. version 9                

. * para que stata use sintaxis de version 9 (en caso de tener una versión posterior)

. set scheme s2manual   // modo monocromático para gráficas

. set more off          // para que el output del DO file no haga pausa al correr

. * Ejemplo de variable ordinal:

. * Actitudes frente a las madres que trabajan

. * Var dep: Esta de acuerdo o no con la frase:

. * "Las mamas que trabajan pueden mantener relaciones calidas con sus hijos"

.

. sysuse ordwarm2, clear

(77 & 89 General Social Survey)

. desc warm yr89 male white age ed prst

              storage  display     value

variable name   type   format      label      variable label

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

warm            byte   %10.0g      sd2sa      Mom can have warm relations

                                                with child

yr89            byte   %10.0g      yrlbl      Survey year: 1=1989 0=1977

male            byte   %10.0g      sexlbl     Gender: 1=male 0=female

white           byte   %10.0g      race2lbl   Race: 1=white 0=not white

age             byte   %10.0g                 Age in years

ed              byte   %10.0g                 Years of education

prst            byte   %10.0g                 Occupational prestige

. sum warm yr89 male white age ed prst

    Variable |       Obs        Mean    Std. Dev.       Min        Max

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

        warm |      2293    2.607501    .9282156          1          4

        yr89 |      2293    .3986044    .4897178          0          1

        male |      2293    .4648932    .4988748          0          1

       white |      2293    .8765809    .3289894          0          1

         age |      2293    44.93546    16.77903         18         89

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

          ed |      2293    12.21805    3.160827          0         20

        prst |      2293    39.58526    14.49226         12         82

.

. tab warm

. *(“Working mom’s can have warm relations with children”)

    Mom can |

  have warm |

  relations |

 with child |      Freq.     Percent        Cum.

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

        1SD |        297       12.95       12.95

         2D |        723       31.53       44.48

         3A |        856       37.33       81.81

        4SA |        417       18.19      100.00

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

      Total |      2,293      100.00

. * Var. Dep.: ¿Está de acuerdo o no con la frase?

. * "Las mamás que trabajan pueden mantener relaciones calidas con sus hijos"

.

. //  Un modelo de regresión logístico ordinal

. ologit warm male white age ed prst, nolog       // muestra completa

Ordered logistic regression                       Number of obs   =       2293

                                                  LR chi2(5)      =     258.39

                                                  Prob > chi2     =     0.0000

Log likelihood = -2866.5752                       Pseudo R2       =     0.0431

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

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

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

        male |  -.7499562   .0783083    -9.58   0.000    -.9034377   -.5964747

       white |  -.4127267   .1180436    -3.50   0.000    -.6440879   -.1813655

         age |  -.0206757   .0024598    -8.41   0.000    -.0254967   -.0158547

          ed |   .0789344   .0158731     4.97   0.000     .0478238    .1100451

        prst |   .0066996   .0032863     2.04   0.041     .0002585    .0131408

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

       /cut1 |  -2.466022   .2386009                     -2.933671   -1.998373

       /cut2 |  -.6564482   .2329347                     -1.112992   -.1999045

       /cut3 |   1.215503   .2335542                      .7577454    1.673261

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

. * la opcion nolog omite el output de las iteraciones

. ologit warm male white age ed prst if yr89==1, nolog  // muestra restringida

...

Descargar como (para miembros actualizados)  txt (73 Kb)   pdf (315 Kb)   docx (125 Kb)  
Leer 89 páginas más »
Disponible sólo en Clubensayos.com