Session Ready
Exercise

Categorical Predictors I

So far we have given participants money, smiled at them, but haven't said anything - a bit creepy, right?

Let's include a variable called talk. We either said something neutral ("Nice weather today"), rude ("You smell"), or polite ("You are great"). We coded these responses as 1, 2, and 3, respectively. We have to tell R that these values (1, 2, and 3) are categories and not numbers! We do this by making them into factors using the function as.factor(). For example: as.factor(variable). This tells R that 'data' is categorical.

Let's make talk into a categorical variable, and add it to our regression analysis!

Instructions
100 XP
  • In your script, add talk to your regression model as a predictor.
  • In your regression mode, use the function as.factor() on talk so that the model knows that the variable talk is a factor (category).
  • Hit "Submit" and look at the outcome!