+ Reply to Thread
Results 1 to 2 of 2

Thread: Predictive value of X for a change in Y?

  1. #1
    Points: 795, Level: 14
    Level completed: 95%, Points required for next Level: 5

    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Predictive value of X for a change in Y?




    Hi everyone,

    R question:
    10 participants underwent a weight loss programme, like so:
    mydata<-as.data.frame(matrix(c(140,125,120,115,110,110,110,105,100,90,85,100,140,70,100,100,140,120,
    220,190,90,100,120,60,90,110,130,110,120,140,NA,65,110,50,NA,90,120,NA,130,150,NA,60,NA,45,
    NA,NA,110,NA,160,NA),nrow=10,dimnames=list(c(1:10),c("IQ","Weight.year.1","Weight.year.2",
    "Weight.year.3","Weight.year.4"))))

    I wonder if IQ predicts weight loss success.

    I should not compute the delta, i.e.
    lm((Weight.year.1-Weight.year.4)~IQ,data=mydata)
    since heavier people have more potential to lose weight, and results would be biased. It also fails due to many missings.

    One idea is to compute and use the person-specific coefficients, i.e.
    sapply(1:10,function(i){lm(t(mydata[i,2:5])~c(1:4))$coefficients[2]})
    which, however, still is related to baseline weight. Further, adding the baseline weight to a regression model is discouraged in literature.

    I am looking to give it a new try with random intercepts, but sadly I do not quite understand how to code this in R. Does anyone know of code to run such an analysis? Any help would be greatly appreciated!!

    Kindest regards.

  2. #2
    TS Contributor
    Points: 12,227, Level: 72
    Level completed: 45%, Points required for next Level: 223
    rogojel's Avatar
    Location
    I work in Europe, live in Hungary
    Posts
    1,470
    Thanks
    160
    Thanked 332 Times in 312 Posts

    Re: Predictive value of X for a change in Y?


    How about using percentage weight loss as the DV? And checking for a nonlinear relationship?

    regatds

+ Reply to Thread

           




Tags for this 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