I am working on generating a dataset with n=20 in a linear regression y=b0+b1x+e* (i am not sure whether i should include the error term in my code).
- x and y are normally distributed with mean 0 and standard deviation 1.
- the error term e is also said to be normally distributed with mean 0 and sd 1, BUT with 10% identical outliers in the y direction
My code starts with this
n11 <- 20
m1 <- 0
b0 <- 0
b1 <- 1
x <- rnorm(n11,m1, sd1)
y <- b0 + b1*x + e11
e11 <- rnorm(n11,m1, sd1)
I don't know how and where I should put in code the said 10% identical outliers in the y direction I need help. Thank you so much.