导入函数包psych
library()这个函数是把括号内包含的函数包导枝哪入,然后才可以运用psych中的一些则裂现成的函数or模型。
psych函数包好像是一个和心理学等有关的函数包,Rstudio里孙搭闭给的psych函数包的定义如下:
A general purpose toolbox for personality, psychometric theory and experimental psychology. Functions are primarily for multivariate analysis and scale construction using factor analysis, principal component analysis, cluster analysis and reliability analysis, although others provide basic descriptive statistics. Item Response Theory is done using factor analysis of tetrachoric and polychoric correlations. Functions for analyzing data at multiple levels include within and between group statistics, including correlations and factor analysis. Functions for simulating and testing particular item and test structures are included. Several functions serve as a useful front end for structural equation modeling. Graphical displays of path diagrams, factor analysis and structural equation models are created using basic graphics. Some of the functions are written to support a book on psychometric theory as well as publications in personality research. For more information, see the <https://personality-project.org/r>web page.
上述英文来自:网页链接
表型数据的描述性统计,是对表型数据进行的基础分析,包括最大值、最小是、均值、方差、极差等。通过SPSS、Excel或者R都可以完成,R与其他两种圆则配方法对比,只需要简单的命令就可以完成全部分析,盯孙这里主要介绍R包'psych'。
这里的数据格式为常用的长数据,即第一行为表头,每一列为性状观测值的名称,如株高、茎粗、分枝数、千粒重等。
我这里的数据分别为:株系,时间,重复,年份,之后为每个性状的测量值。
调用R包:
读取宽数据:
我需要每个时间点单独统计,提取时间:
统计,这里第五列开始为我需要的表型性状:
查看结果:
结果中包含每个性状在T1时间点的平均值,标准差,最小值,最大值,偏度,峰度等我们需橘指要的所有描述性统计结果。
将上一步的描述性统计结果输出:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)