“用R进行描述性统计”的版本间的差异
Lichaoping(讨论 | 贡献) (创建页面,内容为“==脚本与注释== <pre>datafilename <- "http://personality-project.org/r/datasets/maps.mixx.epi.bfi.data" # 指定文件名与路径 mydata <- read.table(datafile...”) |
Lichaoping(讨论 | 贡献) |
||
第6行: | 第6行: | ||
decribe(epi) # 描述性统计 | decribe(epi) # 描述性统计 | ||
describe(epi,fast=TRUE) # 快速描述性统计,得到核心结果</pre> | describe(epi,fast=TRUE) # 快速描述性统计,得到核心结果</pre> | ||
+ | |||
+ | ==结果== | ||
+ | > describe(epi) #描述性统计结果。可以把结果复制到Editplus或notepad++,然后复制平均值与标准差两列到论文中 | ||
+ | vars n mean sd median trimmed mad min max range skew kurtosis se | ||
+ | epiE 1 231 13.33 4.14 14 13.49 4.45 1 22 21 -0.33 -0.06 0.27 | ||
+ | epiS 2 231 7.58 2.69 8 7.77 2.97 0 13 13 -0.57 -0.02 0.18 | ||
+ | epiImp 3 231 4.37 1.88 4 4.36 1.48 0 9 9 0.06 -0.62 0.12 | ||
+ | epilie 4 231 2.38 1.50 2 2.27 1.48 0 7 7 0.66 0.24 0.10 | ||
+ | epiNeur 5 231 10.41 4.90 10 10.39 4.45 0 23 23 0.06 -0.50 0.32 | ||
+ | |||
+ | > describe(epi,fast=TRUE) #快速描述性统计结果。可以把结果复制到Editplus或notepad++,然后复制平均值与标准差两列到论文中 | ||
+ | vars n mean sd min max range se | ||
+ | epiE 1 231 13.33 4.14 1 22 21 0.27 | ||
+ | epiS 2 231 7.58 2.69 0 13 13 0.18 | ||
+ | epiImp 3 231 4.37 1.88 0 9 9 0.12 | ||
+ | epilie 4 231 2.38 1.50 0 7 7 0.10 | ||
+ | epiNeur 5 231 10.41 4.90 0 23 23 0.32 |
2017年3月5日 (日) 08:56的版本
脚本与注释
datafilename <- "http://personality-project.org/r/datasets/maps.mixx.epi.bfi.data" # 指定文件名与路径 mydata <- read.table(datafilename,header=TRUE) # 读取数据到mydata attach(mydata) # 激活mydata epi <- data.frame(epiE ,epiS ,epiImp ,epilie ,epiNeur) # 从mydata中提取数据子集,只包括要分析的变量 decribe(epi) # 描述性统计 describe(epi,fast=TRUE) # 快速描述性统计,得到核心结果
结果
> describe(epi) #描述性统计结果。可以把结果复制到Editplus或notepad++,然后复制平均值与标准差两列到论文中
vars n mean sd median trimmed mad min max range skew kurtosis se
epiE 1 231 13.33 4.14 14 13.49 4.45 1 22 21 -0.33 -0.06 0.27 epiS 2 231 7.58 2.69 8 7.77 2.97 0 13 13 -0.57 -0.02 0.18 epiImp 3 231 4.37 1.88 4 4.36 1.48 0 9 9 0.06 -0.62 0.12 epilie 4 231 2.38 1.50 2 2.27 1.48 0 7 7 0.66 0.24 0.10 epiNeur 5 231 10.41 4.90 10 10.39 4.45 0 23 23 0.06 -0.50 0.32
> describe(epi,fast=TRUE) #快速描述性统计结果。可以把结果复制到Editplus或notepad++,然后复制平均值与标准差两列到论文中
vars n mean sd min max range se
epiE 1 231 13.33 4.14 1 22 21 0.27 epiS 2 231 7.58 2.69 0 13 13 0.18 epiImp 3 231 4.37 1.88 0 9 9 0.12 epilie 4 231 2.38 1.50 0 7 7 0.10 epiNeur 5 231 10.41 4.90 0 23 23 0.32