Grokbase Groups R r-help March 2002
FAQ
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)))
sem(pnet.lai)
Error in sem(pnet.lai) : couldn't find function "stdev"


It looks like there is no stdev function in R

Thanks,

Kirk



Kirk R. Wythers email: kwythers at umn.edu
University of Minnesota tel: 612.625.2261
Department of Forest Resources fax: 612.625.5212
Saint Paul, MN 55108


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Search Discussions

  • Peter Dalgaard BSA at Mar 1, 2002 at 3:44 pm

    "Kirk R. Wythers" <kwythers@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)))
    sem(pnet.lai)
    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.

    --
    O__ ---- Peter Dalgaard Blegdamsvej 3
    c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
    (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
    ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • JRG at Mar 1, 2002 at 5:18 pm

    On 1 Mar 02, at 16:44, Peter Dalgaard BSA wrote:

    "Kirk R. Wythers" <kwythers@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)))
    sem(pnet.lai)
    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))) ?

    ---JRG


    John R. Gleason

    Syracuse University
    430 Huntington Hall Voice: 315-443-3107
    Syracuse, NY 13244-2340 USA FAX: 315-443-4085

    PGP public key at keyservers
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • Peter Dalgaard BSA at Mar 1, 2002 at 7:01 pm

    "JRG" <loesljrg@accucom.net> writes:
    On 1 Mar 02, at 16:44, Peter Dalgaard BSA wrote:

    "Kirk R. Wythers" <kwythers@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)))
    sem(pnet.lai)
    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))) ?
    Um. Yes.

    On the other hand, I didn't say *what* it killed, did I? ;-)

    -p

    --
    O__ ---- Peter Dalgaard Blegdamsvej 3
    c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
    (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
    ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • Andrew Perrin at Mar 1, 2002 at 4:49 pm
    try sd(x)

    ap

    ----------------------------------------------------------------------
    Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
    Assistant Professor of Sociology, U of North Carolina, Chapel Hill
    269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA

    On 1 Mar 2002, Kirk R. Wythers wrote:

    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)))
    sem(pnet.lai)
    Error in sem(pnet.lai) : couldn't find function "stdev"


    It looks like there is no stdev function in R

    Thanks,

    Kirk



    Kirk R. Wythers email: kwythers at umn.edu
    University of Minnesota tel: 612.625.2261
    Department of Forest Resources fax: 612.625.5212
    Saint Paul, MN 55108


    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedMar 1, '02 at 3:15p
activeMar 1, '02 at 7:01p
posts5
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase