```
zstat <- qnorm(.975, mean = 0, sd = 1, lower.tail = TRUE)
cat("zstat=",zstat,"\n","\n")
for(i in 1:11) {
v <- paste("x",i,sep="")
print(v)
data_outliers <- subset(zf, abs(df3[[v]]) > zstat)
numOutliers <- dim(data_outliers)[1]
cat("Number of outliers is ", numOutliers, "\n")
cat("outlier ids are","\n")
print(data_outliers$id)
data_nooutliers <- subset(zf, abs(df3[[v]])< zstat)
numNooutliers <- dim(data_nooutliers)[1]
cat(" ","\n")
cat("Number of nooutliers is ", numNooutliers, "\n")
cat("first 25 nooutlier ids are","\n")
print(head(data_nooutliers$id,25))
cat("\n","numOutliers+numNooutliers=",numOutliers+numNooutliers,"\n","\n")
#For each xi I want to create a file name xi.outliers, write that out to a csv file
#I will want to do a union join of these xi.outliers to find ids of outliers to be removed from zf
#I am not sure how to fix the error
string1 <- paste("x",i,sep="")
string2 <- ".outliers$id"
S <- paste(string1, string2, sep ="")
print(head(S,25))
S <- data_outliers$id
write.csv(S,"S.outliers.csv",row.names=none)
}
```

OUTPUT

[1] "x1"

Number of outliers is 347

outlier ids are

[1] 4 46 57 114 198 206 207 210 213 242 244 245 251 253 260 265 266 270 272 273

. . .

[341] 4472 4865 5859 6046 6386 6387 6447

Number of nooutliers is 6150

first 25 nooutlier ids are

[1] 1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

numOutliers+numNooutliers= 6497

[1] "x1.outliers$id"

Error in eval(expr, p) : object 'none' not found