Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GEE hierarchical stepwise regression

    Hi! I've been trying to run a stepwise hierarchical GEE analysis on a panel data. I've managed to successfully conduct the stepwise regression, but when I try doing it hierarchically I keep getting an error message. I was wondering why this might be? All answers are much appreciated. Thanks!

  • #2
    Originally posted by hale be View Post
    Hi! I've been trying to run a stepwise hierarchical GEE analysis on a panel data. I've managed to successfully conduct the stepwise regression
    How did you manage to do that?

    . stepwise, pr(0.2): xtgee mpg c.(headroom trunk weight length turn displacement gear_ratio), i(rep78)
    xtgee is not supported by stepwise
    r(199);


    Which is consistent with the documentation for -stepwise-. (If that isn't what you were doing, then you should probably look into this.)

    when I try doing it hierarchically I keep getting an error message. . . .All answers are much appreciated. Thanks!
    You can fit the most common GEE model using -glm-, and -glm- allows -stepwise-. See below.

    .ÿ
    .ÿversionÿ16.1

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿsetÿseedÿ`=strreverse("1603424")'

    .ÿ
    .ÿquietlyÿsysuseÿauto

    .ÿsummarizeÿrep78,ÿmeanonly

    .ÿquietlyÿreplaceÿrep78ÿ=ÿruniformint(`r(min)',ÿ`r(max)')ÿifÿmi(rep78)

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿtempnameÿGEEÿGLM

    .ÿ
    .ÿquietlyÿxtgeeÿmpgÿc.(headroomÿtrunkÿweightÿlengthÿturnÿdisplacementÿgear_ratio),ÿ///
    >ÿÿÿÿÿÿÿÿÿi(rep78)ÿfamily(gaussian)ÿlink(identity)ÿcorr(independent)ÿvce(robust)ÿnolog

    .ÿmatrixÿdefineÿ`GEE'ÿ=ÿe(b)

    .ÿ
    .ÿquietlyÿglmÿmpgÿc.(headroomÿtrunkÿweightÿlengthÿturnÿdisplacementÿgear_ratio),ÿ///
    >ÿÿÿÿÿÿÿÿÿfamily(gaussian)ÿlink(identity)ÿvce(clusterÿrep78)ÿnolog

    .ÿmatrixÿdefineÿ`GLM'ÿ=ÿe(b)

    .ÿ
    .ÿmata:ÿmreldif(st_matrix(st_local("GEE")),ÿst_matrix(st_local("GLM")))
    ÿÿ5.66491e-14

    .ÿ
    .ÿ//ÿSo,ÿ.ÿ.ÿ.
    .ÿstepwise,ÿpr(0.2)ÿhierarchical:ÿ///
    >ÿÿÿÿÿÿÿÿÿglmÿmpgÿc.(headroomÿtrunkÿweightÿlengthÿturnÿdisplacementÿgear_ratio),ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿfamily(gaussian)ÿlink(identity)ÿvce(clusterÿrep78)
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿbeginÿwithÿfullÿmodel
    pÿ=ÿ0.7652ÿ>=ÿ0.2000ÿÿremovingÿgear_ratio
    pÿ=ÿ0.2567ÿ>=ÿ0.2000ÿÿremovingÿdisplacement
    pÿ=ÿ0.7642ÿ>=ÿ0.2000ÿÿremovingÿturn
    pÿ=ÿ0.0667ÿ<ÿÿ0.2000ÿÿkeepingÿÿlength

    GeneralizedÿlinearÿmodelsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
    Optimizationÿÿÿÿÿ:ÿMLÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿResidualÿdfÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ70
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿScaleÿparameterÿ=ÿÿÿÿ11.9814
    Devianceÿÿÿÿÿÿÿÿÿ=ÿÿ826.7167277ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1/df)ÿDevianceÿ=ÿÿÿ11.81024
    Pearsonÿÿÿÿÿÿÿÿÿÿ=ÿÿ826.7167277ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1/df)ÿPearsonÿÿ=ÿÿÿ11.81024

    Varianceÿfunction:ÿV(u)ÿ=ÿ1ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[Gaussian]
    Linkÿfunctionÿÿÿÿ:ÿg(u)ÿ=ÿuÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[Identity]

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿAICÿÿÿÿÿÿÿÿÿÿÿÿÿ=ÿÿÿ5.359382
    Logÿpseudolikelihoodÿ=ÿ-194.2971409ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBICÿÿÿÿÿÿÿÿÿÿÿÿÿ=ÿÿÿ525.4322

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Std.ÿErr.ÿadjustedÿforÿ5ÿclustersÿinÿrep78)
    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRobust
    ÿÿÿÿÿÿÿÿÿmpgÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿheadroomÿ|ÿÿÿ.0161296ÿÿÿ.4948527ÿÿÿÿÿ0.03ÿÿÿ0.974ÿÿÿÿ-.9537639ÿÿÿÿ.9860231
    ÿÿÿÿÿÿÿtrunkÿ|ÿÿ-.0342372ÿÿÿ.0847613ÿÿÿÿ-0.40ÿÿÿ0.686ÿÿÿÿ-.2003664ÿÿÿÿ.1318919
    ÿÿÿÿÿÿweightÿ|ÿÿ-.0038778ÿÿÿ.0012589ÿÿÿÿ-3.08ÿÿÿ0.002ÿÿÿÿ-.0063453ÿÿÿ-.0014104
    ÿÿÿÿÿÿlengthÿ|ÿÿ-.0742607ÿÿÿ.0405048ÿÿÿÿ-1.83ÿÿÿ0.067ÿÿÿÿ-.1536485ÿÿÿÿ.0051272
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ47.38497ÿÿÿ6.952426ÿÿÿÿÿ6.82ÿÿÿ0.000ÿÿÿÿÿ33.75847ÿÿÿÿ61.01147
    ------------------------------------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment

    Working...
    X