I am very new to RStudio so this is probably a very basic questions, but I get the error " $ operator is invalid for atomic vectors" when I want to get the plots of a multiple linear regression with General Happiness as my dependent variable and Job Satisfaction as the independent variable. I want to use Age and Gender as the controll variables. I only get 2 plots, but there should be 2 (Cook's Distance and fitted vs. residuals).
This is the data I use:
This is my code so far:
mult.reg <-lm(ESS$happy ~ ESS$stfjb + ESS$agea + ESS$gndr)
Can someone help me out and tell me what the problem is and what's to be done to solve it?