+ Reply to Thread
Results 1 to 4 of 4

Thread: How can I obtain contrast statment for linear trend test ?

  1. #1
    Points: 4, Level: 1
    Level completed: 7%, Points required for next Level: 46

    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I obtain contrast statment for linear trend test ?




    Hi, I hope someone can explain this to me. I have obtained the following from the SAS website, but I cannot apply it to my data where I have 11 dose groups. I don't understand how the linear contrast given (-3 -1 1 3) is a linear trend ?

    From a SAS example with variable dose at 4 levels :

    proc glm;
    class dose;
    model y=dose;
    contrast 'linear' dose -3 -1 1 3;
    run;

    I don't know how the contrast -3 -1 1 3 has been derived and so I can't derive my own contrast statement for my data with 11 dose levels. I am used to determining contrast statements by writing as below. In the example below I will assume I want to test :

    Ho : mu11 - mu12 = 0

    mu11 - mu12 = (mu+a1+b1+ab11) - (mu+a1+b2+ab12) = b1 - b2 + ab11 + ab12

    I would then write out the contrast as contrast 'ab11 - ab12' b 1 -1;

    Here for the linear trend I'm not sure how to express the contrast in terms of model parameters. Can anyone help. I guess if I could understand the example given above this would help me. Thanks.

  2. #2
    Points: 3,730, Level: 38
    Level completed: 54%, Points required for next Level: 70

    Posts
    155
    Thanks
    7
    Thanked 30 Times in 29 Posts

    Re: How can I obtain contrast statment for linear trend test ?

    This is more of a SAS question than a biostatistics question. It seems that you would want to perform a contrast consisting of comparing the first and second dose, second and third dose, third and fourth dose...., and tenth and eleventh dose, which is a test with 10df. You should look up and double check the parameterization used by proc glm, since this will determine how you write the contrasts. Once you know the parameterization the rest is fairly straightforward, just write the contrast for comparing dose 1 and 2, dose 2 and 3,..., dose 10 and 11. If you add /e before the semicolon in the contrast statement, this will print the L vector, which can help you to double check that you specified the correct contrasts.

  3. #3
    Omega Contributor
    Points: 38,303, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,993
    Thanks
    397
    Thanked 1,185 Times in 1,146 Posts

    Re: How can I obtain contrast statment for linear trend test ?

    Quote Originally Posted by Bracknell View Post
    Ho : mu11 - mu12 = 0

    mu11 - mu12 = (mu+a1+b1+ab11) - (mu+a1+b2+ab12) = b1 - b2 + ab11 + ab12

    I would then write out the contrast as contrast 'ab11 - ab12' b 1 -1;

    Here for the linear trend I'm not sure how to express the contrast in terms of model parameters. Can anyone help. I guess if I could understand the example given above this would help me. Thanks.


    I didnt follow what you were trying to state here??

    If you are trying to report a linear trend for your categorical variable that has 12 groups i can provide the code tomorrow (currently on a small/old tablet) . The contrast is just using a SAS style dummy coding. The code will look like yourr posted example but go out to something like -9 and 9. You can pribably find an example if you keep searching the web or i will post it in the morning.
    Stop cowardice, ban guns!

  4. #4
    Omega Contributor
    Points: 38,303, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,993
    Thanks
    397
    Thanked 1,185 Times in 1,146 Posts

    Re: How can I obtain contrast statment for linear trend test ?


    Dummy coding was an incorrect term for me to use, I think. The two posts below should provide the insight needed. The first provides examples up to 9 and the second provides some of the logit behind using the numbers they do in contrasts. So based on these it seems you should use the following:

    Code: 
    proc glm;
    class dose;
    model y=dose;
    contrast 'linear' dose -11 -9 -7 -5 -3 -1 1 3 5 7 9 11; /*sum to zero*/
    run;
    


    http://www.ats.ucla.edu/stat/sas/lib...ASAnova_mf.htm

    https://communities.sas.com/thread/51663
    Stop cowardice, ban guns!

  5. The Following User Says Thank You to hlsmith For This Useful Post:

    Disvengeance (12-02-2014)

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats