Announcement

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

  • repeated measurements for exposure and one mesurement for outcome

    Dear members

    I am conducting a study where (among other things) I intend to explore the association between a biomarker (the exposure; not normally distributed) and three outcomes (in separate analyses); one dichotomous (yes/no), one with 4 or 5 categories (not decided yet) and the third a continuous variable

    The exposure is measured twice in two different point in time (1999 and 2018) while the outcome only once (ongoing, in 2020).

    Thnkful on any advice refgarding data analyses

    Regards
    Gerhard

  • #2
    Maybe something like a generalized MIMIC? Illustrated below. (Start at the "Begin here" comment; the first part of the output is to create a fictional dataset with characteristics that follow your description.)

    .ÿ
    .ÿversionÿ16.1

    .ÿ
    .ÿclearÿ*

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

    .ÿ
    .ÿquietlyÿdrawnormÿout1ÿlat2ÿout3,ÿdoubleÿ///
    >ÿÿÿÿÿÿÿÿÿcorr(1ÿ0.5ÿ0.5ÿ\ÿ0.5ÿ1ÿ0.5ÿ\ÿ0.5ÿ0.5ÿ1)ÿn(250)

    .ÿ
    .ÿquietlyÿreplaceÿout1ÿ=ÿout1ÿ>ÿ0ÿ//ÿ"oneÿdichotomous"

    .ÿegenÿbyteÿout2ÿ=ÿcut(lat2),ÿgroup(5)ÿ//ÿ"oneÿwithÿ4ÿorÿ5ÿcategories"

    .ÿ
    .ÿdrawnormÿbmk1999ÿbmk2018,ÿdoubleÿcorr(1ÿ0.5ÿ\ÿ0.5ÿ1)

    .ÿforeachÿvarÿofÿvarlistÿb*ÿ{
    ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿ`var'ÿ=ÿexp(`var')
    ÿÿ3.ÿ}

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿgsemÿ///
    >ÿÿÿÿÿÿÿÿÿ(out1ÿ<-ÿF,ÿprobit)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(out2ÿ<-ÿF,ÿoprobit)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(out3ÿ<-ÿF,ÿregress)ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Fÿ<-ÿc.bmk1999ÿc.bmk2018),ÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnocnsreportÿnodvheaderÿnolog

    GeneralizedÿstructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ250
    Logÿlikelihoodÿ=ÿ-867.63572

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    out1ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿÿÿÿÿÿ_consÿ|ÿÿ-.0070978ÿÿÿ.1285834ÿÿÿÿ-0.06ÿÿÿ0.956ÿÿÿÿ-.2591167ÿÿÿÿ.2449211
    -------------+----------------------------------------------------------------
    out2ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ.8305157ÿÿÿ.2383966ÿÿÿÿÿ3.48ÿÿÿ0.000ÿÿÿÿÿ.3632669ÿÿÿÿ1.297764
    -------------+----------------------------------------------------------------
    out3ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ.7527934ÿÿÿÿ.223481ÿÿÿÿÿ3.37ÿÿÿ0.001ÿÿÿÿÿ.3147788ÿÿÿÿ1.190808
    ÿÿÿÿÿÿÿ_consÿ|ÿÿ-.0012483ÿÿÿ.0808873ÿÿÿÿ-0.02ÿÿÿ0.988ÿÿÿÿ-.1597845ÿÿÿÿ.1572879
    -------------+----------------------------------------------------------------
    Fÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿbmk1999ÿ|ÿÿÿ-.020297ÿÿÿ.0488067ÿÿÿÿ-0.42ÿÿÿ0.678ÿÿÿÿ-.1159564ÿÿÿÿ.0753624
    ÿÿÿÿÿbmk2018ÿ|ÿÿÿ.0134408ÿÿÿ.0393328ÿÿÿÿÿ0.34ÿÿÿ0.733ÿÿÿÿÿÿ-.06365ÿÿÿÿ.0905316
    -------------+----------------------------------------------------------------
    /out2ÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿcut1ÿ|ÿÿ-1.041896ÿÿÿ.1348914ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-1.306278ÿÿÿ-.7775136
    ÿÿÿÿÿÿÿÿcut2ÿ|ÿÿ-.3219072ÿÿÿ.1157169ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-.5487081ÿÿÿ-.0951063
    ÿÿÿÿÿÿÿÿcut3ÿ|ÿÿÿ.2986976ÿÿÿ.1180947ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0672362ÿÿÿÿÿ.530159
    ÿÿÿÿÿÿÿÿcut4ÿ|ÿÿÿ1.027323ÿÿÿ.1427469ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.7475445ÿÿÿÿ1.307102
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿvar(e.F)|ÿÿÿ.7537555ÿÿÿ.3518509ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.3019201ÿÿÿÿ1.881781
    -------------+----------------------------------------------------------------
    ÿÿvar(e.out3)|ÿÿÿ.4234712ÿÿÿ.0984557ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.2684863ÿÿÿÿ.6679217
    ------------------------------------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .ÿhelpÿsem

    .


    See in the user's manual for sem Examples 36g for an illustration of the generalized version and Example 10 for an illustration of the SEM archetype.

    Comment

    Working...
    X