On 1 Mar 02, at 16:44, Peter Dalgaard BSA wrote:
"Kirk R. Wythers" <kwythers at umn.edu> writes:
Is there a "canned" function in R for finding the standard error of the
mean? I have tried
sem <- function(x) c(mean =mean(x),
+ SEM = stdev(x)/sqrt(length(x)))
Error in sem(pnet.lai) : couldn't find function "stdev"
It looks like there is no stdev function in R
It's sd() (as help.search("deviation") might have told you). Also,
beware of missing values: sd(x,na.rm=TRUE)/sum(!is.na(x)) is the sure
kill.
Would that perhaps be sd(x,na.rm=TRUE)/sqrt(sum(!is.na(x))) ?