Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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 ACF函数出错:获取结果中的所有NAs_R_Longitudinal_Autocorrelation - Fatal编程技术网

R ACF函数出错:获取结果中的所有NAs

R ACF函数出错:获取结果中的所有NAs,r,longitudinal,autocorrelation,R,Longitudinal,Autocorrelation,嗨,我有一个纵向数据集,我们有关于专业人士和马斯拉赫职业倦怠量表得分的数据 The basic data looks like: data.frame': 1907 obs. of 22 variables: $ MBI_1 : num 6 4 2 3 7 5 6 6 6 4 ... $ MBI_2 : num 5 6 0 2 5 4 4 5 5 2 ... $ MBI_3 : num 4 4 0 2 4 4 1 3 4 2 ... $ MBI_4 : num 4 14

嗨,我有一个纵向数据集,我们有关于专业人士和马斯拉赫职业倦怠量表得分的数据

The basic data looks like:
data.frame':    1907 obs. of  22 variables:
 $ MBI_1 : num  6 4 2 3 7 5 6 6 6 4 ...
 $ MBI_2 : num  5 6 0 2 5 4 4 5 5 2 ...
 $ MBI_3 : num  4 4 0 2 4 4 1 3 4 2 ...
 $ MBI_4 : num  4 14 7 4 1 9 6 8 9 6 ...
 $ MBI_5 : num  3 12 6 3 1 3 7 7 7 3 ...
 $ MBI_6 : num  8 3 6 3 5 3 5 6 6 4 ...
 $ MBI_7 : num  5 14 8 10 1 10 10 8 8 6 ...
 $ MBI_8 : num  3 2 0 1 4 4 2 3 3 2 ...
 $ MBI_9 : num  2 11 7 6 7 7 5 7 6 4 ...
 $ MBI_10: num  3 10 4 3 4 5 9 6 9 3 ...
 $ MBI_11: num  3 8 4 4 7 7 8 6 8 5 ...
 $ MBI_12: num  6 3 6 6 7 5 4 7 7 2 ...
 $ MBI_13: num  4 6 6 4 6 3 5 4 8 2 ...
 $ MBI_14: num  0 4 0 1 4 3 1 2 3 0 ...
 $ MBI_15: num  3 12 3 3 1 3 8 5 6 3 ...
 $ MBI_16: num  5 5 3 2 2 4 3 1 6 2 ...
 $ MBI_17: num  3 14 9 7 3 9 7 1 9 5 ...
 $ MBI_18: num  3 13 3 6 9 9 4 6 9 3 ...
 $ MBI_19: num  8 6 4 6 9 9 5 8 10 3 ...
 $ MBI_20: num  0 1 0 0 0 1 1 1 2 0 ...
 $ MBI_21: num  5 5 7 5 1 7 7 6 7 4 ...
 $ MBI_22: num  3 12 3 3 1 3 3 6 5 3 ...
我已经将所有这些分数汇总成一行,并创建了一个名为“mbitot”的新变量,该变量将每个人在每个时间点(恰好是4次访问)的22个答案进行汇总

那里有一些NAs

然后我跑了


    library(nlme)
    fit1=gls(mbi`itot~as.factor(visit),data=mss,na.action=na.exclude)
    ACF(fit1,form=~1|ID)
    ##Output i am getting is
    lag ACF
    1   0  NA
    2   1  NA
    3   2  NA
    4   3  NA
    5   4  NA
    6   5  NA

首先,我无法理解为什么我会得到NAs。 回归总结很好,没有NAs。 回归结果如下: 截距95.93,斜率6.5,相关系数为-0.89

知道我为什么要买这些NAs吗?如有任何意见,将不胜感激。
谢谢

这里的回归公式显示了Y变量的a值为mbi'itot。这是个打字错误。在实际代码中,它被正确地称为mbitot。这里的回归公式显示Y变量的一个值为mbi'itot。这是个打字错误。在实际代码中,它被正确地称为mbitot。

    library(nlme)
    fit1=gls(mbi`itot~as.factor(visit),data=mss,na.action=na.exclude)
    ACF(fit1,form=~1|ID)
    ##Output i am getting is
    lag ACF
    1   0  NA
    2   1  NA
    3   2  NA
    4   3  NA
    5   4  NA
    6   5  NA