1. Learn
  2. /
  3. Courses
  4. /
  5. Helsinki Open Data Science
  • 1

    Regression and model validation

    Data wrangling, simple regression, multiple regression, regression diagnostics

  • 2

    Logistic regression

    Regression for binary outcomes, training and testing a (predictive) model, cross-validation

  • 3

    Clustering and classification

    Datasets in R, Linear Discriminant Analysis (LDA) and K-means clustering

  • 4

    Dimensionality reduction techniques

    Principal component analysis (PCA), Correspondence analysis (CA)

  • 5

    Analysis of longitudinal data

    Graphical Displays and Summary Measure Approach, Linear Mixed Effects Models for Normal Response Variables


Connected

Exercise

Time to interact: Random Intercept and Random Slope Model with interaction

Finally, we can fit a random intercept and slope model that allows for a group × time interaction.

Instructions

100 XP
  • Write the same model as in the previous exercise but add Time * Group interaction.
  • Print out the summary of the model
  • Compute the analysis of variance tables of the models RATS_ref2 and RATS_ref1
  • Again pay attention to the likelihood ratio test chi-squared value and the according p-value. The lower the value the better the fit against the comparison model.
  • Draw the plot of observed values of RATSL (this is the same plot drawn earlier)
  • Create a vector of the fitted values of the model using the function fitted()
  • Use for example mutate() to add the vector Fitted as a new column to RATSL
  • Draw the plot of fitted values of RATSL