Analyze Repeated Measures Data Using PROC GLIMMIXSAS PROC Transpose DataRepeat several datasets and proc sqlSAS PROC LOGISTIC - why is Goodness of Fit test rejecting model?Modeling longitudinal data with functional coefficients ignoring random effectsVariance Covariance Matrix from Proc GLMR vs. SPSS mixed model repeated measures code [from Cross Validated]How can I produce an estimate for a changing variable using lme4/nlme?How do I run a mixed-effects logistic longitudinal model in R compliant with SAS?PROC PRINT and PROC MEANSSAS proc mianalyze EDF

What could cause the sea level to massively decrease?

The three greedy pirates

Distinguish the explanations of Galadriel's test in LotR

Through: how to use it with subtraction of functions?

Is there a nice way to implement a conditional type with default fail case?

Is it okay to roll multiple attacks that all have advantage in one cluster?

Is there a strong legal guarantee that the U.S. can give to another country that it won't attack them?

Are there any sports for which the world's best player is female?

What's it called when the bad guy gets eaten?

Why does wrapping Aluminium foil around my food help it keep warm, aluminium be good conductor should have no effect?

Why is the ladder of the LM always in the dark side of the LM?

What minifigure is this?

Replace from the current position to the end of the line

Is that a case of "DOUBLE-NEGATIVES" as claimed by Grammarly?

Why does the US seem to have a rather low economic interest in Africa?

What happens to unproductive professors?

What are similar black and/or white permanents to Divine Visitation?

Should I include code in my research paper?

Is there a method for differentiating informative comments from commented out code?

Do I have to worry about delays in international trains? (UK, Belgium, Germany)

Is it possible to see individual photons impressioning film?

"was fiction" vs "were fictions"

BST/GMT to UTC time

Is there any reason why MCU changed the Snap to Blip



Analyze Repeated Measures Data Using PROC GLIMMIX


SAS PROC Transpose DataRepeat several datasets and proc sqlSAS PROC LOGISTIC - why is Goodness of Fit test rejecting model?Modeling longitudinal data with functional coefficients ignoring random effectsVariance Covariance Matrix from Proc GLMR vs. SPSS mixed model repeated measures code [from Cross Validated]How can I produce an estimate for a changing variable using lme4/nlme?How do I run a mixed-effects logistic longitudinal model in R compliant with SAS?PROC PRINT and PROC MEANSSAS proc mianalyze EDF






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am using PROC GLIMMIX to analyze repeated measures data about specific sexual events. The original data came from a weekly diary study of about 400 people. During each week they reported on behaviours from their most recent sexual encounter. We also have basline data on their demographics. 12 weeks of observation were collected and we had a high completion rate.



I would like to create a mixed effect model, but I am unsure exactly how this is done in SAS. I want to test the effect of event-specific factors as well as some person level demographics and would like to get odds ratios for each factor of interest. The outcome is whether or not drugs were used during the event and the explanatory factors will be things like age, gender, etc. as well as characteristics about the event (i.e., partner HIV status), whether the partner was a regular sexual partner, etc..



The code I'm working with follows this pattern:



PROC GLIMMIX DATA=work.dataset oddsratio;
CLASS VISIT_NUMBER PARTICIPANT_ID BINARY_EVENTLEVEL_OUTCOME BINARY_EVENTLEVEL_EXPLANATORY_FACTOR CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR;
MODEL BINARY_EVENTLEVEL_OUTCOME = BINARY_EVENTLEVEL_EXPLANATORY CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR /DIST=binary link=logit CL S ddfm=kr;
RANDOM ?????;
RUN;



  • option 1 for ?????: residual / subject=PARTICIPANT_ID

  • option 2 for ?????: INTERCEPT / subject=PARTICIPANT_ID

  • option 3 for ?????: VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1)
    INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID)

  • option 4 for ?????: Other?

I am also unclear whether I should use ddfm=kr in my model statement or method=laplace in my proc statement -- both have been recommended elsewhere for this sort of repeated measures analysis.



I've come across several potential options for modelling this which often give similar results, but option 1 gives a statistically significant result for an event-level, while the others give non-significant results. The inclusion of the ddfm=kr makes the result of interest more significant. The method=laplace does not allow for option 1.










share|improve this question






























    0















    I am using PROC GLIMMIX to analyze repeated measures data about specific sexual events. The original data came from a weekly diary study of about 400 people. During each week they reported on behaviours from their most recent sexual encounter. We also have basline data on their demographics. 12 weeks of observation were collected and we had a high completion rate.



    I would like to create a mixed effect model, but I am unsure exactly how this is done in SAS. I want to test the effect of event-specific factors as well as some person level demographics and would like to get odds ratios for each factor of interest. The outcome is whether or not drugs were used during the event and the explanatory factors will be things like age, gender, etc. as well as characteristics about the event (i.e., partner HIV status), whether the partner was a regular sexual partner, etc..



    The code I'm working with follows this pattern:



    PROC GLIMMIX DATA=work.dataset oddsratio;
    CLASS VISIT_NUMBER PARTICIPANT_ID BINARY_EVENTLEVEL_OUTCOME BINARY_EVENTLEVEL_EXPLANATORY_FACTOR CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR;
    MODEL BINARY_EVENTLEVEL_OUTCOME = BINARY_EVENTLEVEL_EXPLANATORY CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR /DIST=binary link=logit CL S ddfm=kr;
    RANDOM ?????;
    RUN;



    • option 1 for ?????: residual / subject=PARTICIPANT_ID

    • option 2 for ?????: INTERCEPT / subject=PARTICIPANT_ID

    • option 3 for ?????: VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1)
      INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID)

    • option 4 for ?????: Other?

    I am also unclear whether I should use ddfm=kr in my model statement or method=laplace in my proc statement -- both have been recommended elsewhere for this sort of repeated measures analysis.



    I've come across several potential options for modelling this which often give similar results, but option 1 gives a statistically significant result for an event-level, while the others give non-significant results. The inclusion of the ddfm=kr makes the result of interest more significant. The method=laplace does not allow for option 1.










    share|improve this question


























      0












      0








      0








      I am using PROC GLIMMIX to analyze repeated measures data about specific sexual events. The original data came from a weekly diary study of about 400 people. During each week they reported on behaviours from their most recent sexual encounter. We also have basline data on their demographics. 12 weeks of observation were collected and we had a high completion rate.



      I would like to create a mixed effect model, but I am unsure exactly how this is done in SAS. I want to test the effect of event-specific factors as well as some person level demographics and would like to get odds ratios for each factor of interest. The outcome is whether or not drugs were used during the event and the explanatory factors will be things like age, gender, etc. as well as characteristics about the event (i.e., partner HIV status), whether the partner was a regular sexual partner, etc..



      The code I'm working with follows this pattern:



      PROC GLIMMIX DATA=work.dataset oddsratio;
      CLASS VISIT_NUMBER PARTICIPANT_ID BINARY_EVENTLEVEL_OUTCOME BINARY_EVENTLEVEL_EXPLANATORY_FACTOR CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR;
      MODEL BINARY_EVENTLEVEL_OUTCOME = BINARY_EVENTLEVEL_EXPLANATORY CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR /DIST=binary link=logit CL S ddfm=kr;
      RANDOM ?????;
      RUN;



      • option 1 for ?????: residual / subject=PARTICIPANT_ID

      • option 2 for ?????: INTERCEPT / subject=PARTICIPANT_ID

      • option 3 for ?????: VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1)
        INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID)

      • option 4 for ?????: Other?

      I am also unclear whether I should use ddfm=kr in my model statement or method=laplace in my proc statement -- both have been recommended elsewhere for this sort of repeated measures analysis.



      I've come across several potential options for modelling this which often give similar results, but option 1 gives a statistically significant result for an event-level, while the others give non-significant results. The inclusion of the ddfm=kr makes the result of interest more significant. The method=laplace does not allow for option 1.










      share|improve this question
















      I am using PROC GLIMMIX to analyze repeated measures data about specific sexual events. The original data came from a weekly diary study of about 400 people. During each week they reported on behaviours from their most recent sexual encounter. We also have basline data on their demographics. 12 weeks of observation were collected and we had a high completion rate.



      I would like to create a mixed effect model, but I am unsure exactly how this is done in SAS. I want to test the effect of event-specific factors as well as some person level demographics and would like to get odds ratios for each factor of interest. The outcome is whether or not drugs were used during the event and the explanatory factors will be things like age, gender, etc. as well as characteristics about the event (i.e., partner HIV status), whether the partner was a regular sexual partner, etc..



      The code I'm working with follows this pattern:



      PROC GLIMMIX DATA=work.dataset oddsratio;
      CLASS VISIT_NUMBER PARTICIPANT_ID BINARY_EVENTLEVEL_OUTCOME BINARY_EVENTLEVEL_EXPLANATORY_FACTOR CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR;
      MODEL BINARY_EVENTLEVEL_OUTCOME = BINARY_EVENTLEVEL_EXPLANATORY CATEGORICAL_PERSONLEVEL_EXPLANATORY_FACTOR /DIST=binary link=logit CL S ddfm=kr;
      RANDOM ?????;
      RUN;



      • option 1 for ?????: residual / subject=PARTICIPANT_ID

      • option 2 for ?????: INTERCEPT / subject=PARTICIPANT_ID

      • option 3 for ?????: VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1)
        INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID)

      • option 4 for ?????: Other?

      I am also unclear whether I should use ddfm=kr in my model statement or method=laplace in my proc statement -- both have been recommended elsewhere for this sort of repeated measures analysis.



      I've come across several potential options for modelling this which often give similar results, but option 1 gives a statistically significant result for an event-level, while the others give non-significant results. The inclusion of the ddfm=kr makes the result of interest more significant. The method=laplace does not allow for option 1.







      sas data-analysis longitudinal






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 5:00







      Kiffer Card

















      asked Mar 26 at 0:18









      Kiffer CardKiffer Card

      63 bronze badges




      63 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I may not be answering your question, but might be able to provide a couple of directions:



          To start with the simplest part, your MODEL statement looks correct to me as you want to test event-level factors and person-level demographics which are thus considered as fixed effects.



          Now, as far as the random effects are concerned:



          • the RANDOM statements you propose for options (1) and (2):

            (1) RANDOM _residual_ / subject=PARTICIPANT_ID;

            or

            (2) RANDOM intercept / subject=PARTICIPANT_ID;

            are modeling two different parts of the random effects: the R-side and the G-side, respectively.

            If you are already familiar with PROC MIXED, you may want to notice that your option (1) of using RANDOM _residual_ in PROC GLIMMIX is equivalent to using the REPEATED statement in PROC MIXED that tells that you have repeated measures for PARTICIPANT_ID, which is clearly your case (Ref: "Comparing the GLIMMIX and MIXED Procedures")

          • As for option (3):
            RANDOM VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1) INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID);

            here you are modeling the time component of the repeated measures (visit_num) as a random effect, and this should be included when you believe that there would be a random variation of the response at each of the measurements times (i.e. at each event). At first glance, I don't believe this is relevant in your case, since you are taking this into account already by the fixed effects... but of course I may be wrong by not seeing your data.

          Up to here is what I can contribute at this time.



          As next steps for you to have a better understanding, I would suggest that you:



          1. Read the Overview of the PROC GLIMMIX documentation, in particular the mathematical model specification and all 3 sections therein:
            The Basic Model
            G-Side and R-Side Random Effects and Covariance Structures
            Relationship with Generalized Linear Models

          2. If you are still unsure, ask your question at communities.sas.com which might be able to help you better.

          HTH






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348174%2fanalyze-repeated-measures-data-using-proc-glimmix%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I may not be answering your question, but might be able to provide a couple of directions:



            To start with the simplest part, your MODEL statement looks correct to me as you want to test event-level factors and person-level demographics which are thus considered as fixed effects.



            Now, as far as the random effects are concerned:



            • the RANDOM statements you propose for options (1) and (2):

              (1) RANDOM _residual_ / subject=PARTICIPANT_ID;

              or

              (2) RANDOM intercept / subject=PARTICIPANT_ID;

              are modeling two different parts of the random effects: the R-side and the G-side, respectively.

              If you are already familiar with PROC MIXED, you may want to notice that your option (1) of using RANDOM _residual_ in PROC GLIMMIX is equivalent to using the REPEATED statement in PROC MIXED that tells that you have repeated measures for PARTICIPANT_ID, which is clearly your case (Ref: "Comparing the GLIMMIX and MIXED Procedures")

            • As for option (3):
              RANDOM VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1) INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID);

              here you are modeling the time component of the repeated measures (visit_num) as a random effect, and this should be included when you believe that there would be a random variation of the response at each of the measurements times (i.e. at each event). At first glance, I don't believe this is relevant in your case, since you are taking this into account already by the fixed effects... but of course I may be wrong by not seeing your data.

            Up to here is what I can contribute at this time.



            As next steps for you to have a better understanding, I would suggest that you:



            1. Read the Overview of the PROC GLIMMIX documentation, in particular the mathematical model specification and all 3 sections therein:
              The Basic Model
              G-Side and R-Side Random Effects and Covariance Structures
              Relationship with Generalized Linear Models

            2. If you are still unsure, ask your question at communities.sas.com which might be able to help you better.

            HTH






            share|improve this answer





























              0














              I may not be answering your question, but might be able to provide a couple of directions:



              To start with the simplest part, your MODEL statement looks correct to me as you want to test event-level factors and person-level demographics which are thus considered as fixed effects.



              Now, as far as the random effects are concerned:



              • the RANDOM statements you propose for options (1) and (2):

                (1) RANDOM _residual_ / subject=PARTICIPANT_ID;

                or

                (2) RANDOM intercept / subject=PARTICIPANT_ID;

                are modeling two different parts of the random effects: the R-side and the G-side, respectively.

                If you are already familiar with PROC MIXED, you may want to notice that your option (1) of using RANDOM _residual_ in PROC GLIMMIX is equivalent to using the REPEATED statement in PROC MIXED that tells that you have repeated measures for PARTICIPANT_ID, which is clearly your case (Ref: "Comparing the GLIMMIX and MIXED Procedures")

              • As for option (3):
                RANDOM VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1) INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID);

                here you are modeling the time component of the repeated measures (visit_num) as a random effect, and this should be included when you believe that there would be a random variation of the response at each of the measurements times (i.e. at each event). At first glance, I don't believe this is relevant in your case, since you are taking this into account already by the fixed effects... but of course I may be wrong by not seeing your data.

              Up to here is what I can contribute at this time.



              As next steps for you to have a better understanding, I would suggest that you:



              1. Read the Overview of the PROC GLIMMIX documentation, in particular the mathematical model specification and all 3 sections therein:
                The Basic Model
                G-Side and R-Side Random Effects and Covariance Structures
                Relationship with Generalized Linear Models

              2. If you are still unsure, ask your question at communities.sas.com which might be able to help you better.

              HTH






              share|improve this answer



























                0












                0








                0







                I may not be answering your question, but might be able to provide a couple of directions:



                To start with the simplest part, your MODEL statement looks correct to me as you want to test event-level factors and person-level demographics which are thus considered as fixed effects.



                Now, as far as the random effects are concerned:



                • the RANDOM statements you propose for options (1) and (2):

                  (1) RANDOM _residual_ / subject=PARTICIPANT_ID;

                  or

                  (2) RANDOM intercept / subject=PARTICIPANT_ID;

                  are modeling two different parts of the random effects: the R-side and the G-side, respectively.

                  If you are already familiar with PROC MIXED, you may want to notice that your option (1) of using RANDOM _residual_ in PROC GLIMMIX is equivalent to using the REPEATED statement in PROC MIXED that tells that you have repeated measures for PARTICIPANT_ID, which is clearly your case (Ref: "Comparing the GLIMMIX and MIXED Procedures")

                • As for option (3):
                  RANDOM VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1) INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID);

                  here you are modeling the time component of the repeated measures (visit_num) as a random effect, and this should be included when you believe that there would be a random variation of the response at each of the measurements times (i.e. at each event). At first glance, I don't believe this is relevant in your case, since you are taking this into account already by the fixed effects... but of course I may be wrong by not seeing your data.

                Up to here is what I can contribute at this time.



                As next steps for you to have a better understanding, I would suggest that you:



                1. Read the Overview of the PROC GLIMMIX documentation, in particular the mathematical model specification and all 3 sections therein:
                  The Basic Model
                  G-Side and R-Side Random Effects and Covariance Structures
                  Relationship with Generalized Linear Models

                2. If you are still unsure, ask your question at communities.sas.com which might be able to help you better.

                HTH






                share|improve this answer















                I may not be answering your question, but might be able to provide a couple of directions:



                To start with the simplest part, your MODEL statement looks correct to me as you want to test event-level factors and person-level demographics which are thus considered as fixed effects.



                Now, as far as the random effects are concerned:



                • the RANDOM statements you propose for options (1) and (2):

                  (1) RANDOM _residual_ / subject=PARTICIPANT_ID;

                  or

                  (2) RANDOM intercept / subject=PARTICIPANT_ID;

                  are modeling two different parts of the random effects: the R-side and the G-side, respectively.

                  If you are already familiar with PROC MIXED, you may want to notice that your option (1) of using RANDOM _residual_ in PROC GLIMMIX is equivalent to using the REPEATED statement in PROC MIXED that tells that you have repeated measures for PARTICIPANT_ID, which is clearly your case (Ref: "Comparing the GLIMMIX and MIXED Procedures")

                • As for option (3):
                  RANDOM VISIT_NUM / subject=PARTICIPANT_ID residual type=ar(1) INTERCEPT / subject=VISIT_NUM(PARTICIPANT_ID);

                  here you are modeling the time component of the repeated measures (visit_num) as a random effect, and this should be included when you believe that there would be a random variation of the response at each of the measurements times (i.e. at each event). At first glance, I don't believe this is relevant in your case, since you are taking this into account already by the fixed effects... but of course I may be wrong by not seeing your data.

                Up to here is what I can contribute at this time.



                As next steps for you to have a better understanding, I would suggest that you:



                1. Read the Overview of the PROC GLIMMIX documentation, in particular the mathematical model specification and all 3 sections therein:
                  The Basic Model
                  G-Side and R-Side Random Effects and Covariance Structures
                  Relationship with Generalized Linear Models

                2. If you are still unsure, ask your question at communities.sas.com which might be able to help you better.

                HTH







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 16 at 20:28

























                answered Apr 16 at 3:23









                mastropimastropi

                3132 silver badges6 bronze badges




                3132 silver badges6 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348174%2fanalyze-repeated-measures-data-using-proc-glimmix%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해