rlinear-regressionmulti-levelmultilevel-analysis

compare different multi level regressions


i am struggeling at the following:

My idea is to analyse the development (slope) of an output of different multi level regressions.

The output is matched in my data with 2 different timepoints. I have 3 predictors (senseofhumor, seriousness, friendlyness) These predictors are meassured for many people and groups. And is assume here, that SenseofhumorHIGH (as a special value variable from "senseofhumor" ) might have an impact if its high within a group on the outcome. I also assume the slope might first increase dramatically and than increase slower.

How can I compare different slopes with from different regressions with each other? How is the best way to visualize this slopes?

The code would look something like that:

RandomslopeEC(timepoint1) <- lme(criteria(timepoint1) ~ senseofhumor + seriousness + friendlyness , data = DATA, random = ~ **SenseofhumorHIGH**|group)

RandomslopeEC(timepoint2) <- lme(criteria(timepoint2) ~ senseofhumor + seriousness + friendlyness , data = DATA, random = ~ **SenseofhumorHIGH**|group)

RandomslopeEC(timepoint3) <- lme(criteria(timepoint3) ~ senseofhumor + seriousness + friendlyness , data = DATA, random = ~ **SenseofhumorHIGH**|group)

Thanks a lot in advance


Solution

  • it worked out with changing the format from wide to long.

    I used:

    DATAlong<-  DATA %>%
      gather(`criteriatimepoint1`, `criteriatimepoint2`, `criteriatimepoint3`, key = "timepoint", value = "criteriavalue")
    
    

    for that.

    Afterwards i used

    RandomslopeEC <- lme(criteria) ~ senseofhumor*timepoint + seriousness*timepoint + friendlyness*timepoint , data = DATAlong, random = ~ 1|group/timepoint)
    

    for that.

    I hope this might others help as well.