美文网首页
【R>>std.error】标准误

【R>>std.error】标准误

作者: 高大石头 | 来源:发表于2022-03-31 00:02 被阅读0次

    标准差(standard deviation,sd):多次抽样,数据的离散程度;
    标准误(standard error,se):多次抽样,平均值的离散程度(the standard deviation of the means)。

    标准误
    那么怎么在R中计算se呢?
    我们可以自己构建一个函数:
    rm(list = ls())
    library(tidyverse)
    
    x <- c(1,5,7,-10,9,21)
    
    standard_error <- function(x){
      sd(x)/sqrt(length(x))
    }
    standard_error(x)
    

    其实在plotrix包中有个特定的函数std.error
    #install.packages("plotrix")
    library(plotrix)
    std.error(x)
    

    参考链接:
    简书:标准差与标准误(小洁忘了怎么分身)

    相关文章

      网友评论

          本文标题:【R>>std.error】标准误

          本文链接:https://www.haomeiwen.com/subject/rbkgjrtx.html