I'm trying to import a csv file into R, and I was able to do this by
Lab2x<-read.table("Lab2x.csv").
From here I'm trying to calculate the average, standard deviation, standard error, t-statistic and the p-value. I was taught to do this using:
xbar <- mean(Lab2x) # calculate the sample average
sd <- sqrt(var(Lab2x)) # calculate the sample sd
se <- sd/sqrt(12) # calculate se of sample average
tstat <- (xbar - 2.27)/se # calculate the t statistic
pvalue <- 2*(1-pt(abs(tstat),11)) # calculate the p-value
However, when I try to use any of these I get the error:
Warning message: In mean.default(Lab2x) : argument is not numeric or logical: returning NA
What am I doing wrong/missing?