Hi community,
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:
https://www.file-upload.net/download-13706401/ESS1-8e01.sav.html
This is my code so far:
library(haven)
mult.reg <-lm(ESS$happy ~ ESS$stfjb + ESS$agea + ESS$gndr)
plot(mult.reg)
Can someone help me out and tell me what the problem is and what's to be done to solve it?