Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 利克特数据分析_R_Statistics_Standard Deviation - Fatal编程技术网

R 利克特数据分析

R 利克特数据分析,r,statistics,standard-deviation,R,Statistics,Standard Deviation,我试图计算以下数据帧的R(平均值、sd、var)基本统计数据(此表中的数字是响应频率): 我如何计算我上面提到的内容,并将这些数据可视化?在这种情况下,获取汇总统计数据的唯一方法是强烈假设回答之间的差异都是相同的(例如,“强烈不同意”和“不同意”之间的差异与“不同意”和“不同意”之间的差异相同)如果你愿意做出这样的假设,那么你可以计算加权平均数 tt <- read.table(header=TRUE,textConnection(" Question Strongly_disagree

我试图计算以下数据帧的R(平均值、sd、var)基本统计数据(此表中的数字是响应频率):


我如何计算我上面提到的内容,并将这些数据可视化?

在这种情况下,获取汇总统计数据的唯一方法是强烈假设回答之间的差异都是相同的(例如,“强烈不同意”和“不同意”之间的差异与“不同意”和“不同意”之间的差异相同)如果你愿意做出这样的假设,那么你可以计算加权平均数

tt <- read.table(header=TRUE,textConnection("
 Question Strongly_disagree Disagree Dont_know Agree Strongly_agree
 A             1            1        15       4          25
 B             1            1        18       3          23
 C             0            0        19       1          26"))

 tt2 <- tt[,-1]  ## scores only
 ss <- sweep(tt2,MARGIN=2,FUN="*",1:5) ## weight by numeric equivalent

(您可能希望除以
行和(tt2)-1
以获得样本标准差)。

summary()、mean()、sd()、var()?我认为这个问题更棘手,因为数据已经编译在
类型类中,所以
summary()
等。使用
sos::findFn(“likert”)进行搜索没有多大意义
当这种情绪受到赞赏时,StackOverflow会表示反对;如果这个答案有用,你可以(当你有足够的声誉时)对它进行投票
tt <- read.table(header=TRUE,textConnection("
 Question Strongly_disagree Disagree Dont_know Agree Strongly_agree
 A             1            1        15       4          25
 B             1            1        18       3          23
 C             0            0        19       1          26"))

 tt2 <- tt[,-1]  ## scores only
 ss <- sweep(tt2,MARGIN=2,FUN="*",1:5) ## weight by numeric equivalent
 (meanvals <- rowSums(ss)/rowSums(tt2))
 ## [1] 4.108696 4.000000 4.152174
 devs <- outer(-meanvals,1:5,"+")
 sqrt(rowSums(devs^2*tt2)/rowSums(tt2))