[R] std.error

Bill.Venables at csiro.au Bill.Venables at csiro.au
Sun Aug 30 02:35:40 CEST 2009

"Standard error" usually means the estimated standard deviation of a parameter estimate, e.g. the sample mean.

Perhaps you mean the estimated standard deviation of the data.  If so

sdev <- sd(x, na.rm = TRUE)

If you want the standard error of the mean there are several ways of doing it.  Perhaps the simplest is

seMean <- sd(x, na.rm=TRUE)/sqrt(length(na.omit(x)))

missing values complicate the issue just a little.

Bill Venables.
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Mcdonald, Grant [grant.mcdonald08 at imperial.ac.uk]
Sent: 29 August 2009 04:50
To: r-help at R-project.org
Subject: [R] std.error

dear sir,

i am trying to calculate the standard error of my data (x),

i have tried se(x, na.rm=TRUE)
and std.error(x)

neither have worked and i cannot find an alternative

sorry to bother with such a basic problem
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list