- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想制作一个交互图,以从回归模型的结果中直观地显示分类变量(4 个级别)和标准化连续变量的交互斜率的差异或相似性。with(GLMModel, interaction.plot(continuous.var, categorical.var, response.var))
不是我要找的。它生成一个图,其中斜率随连续变量的每个值而变化。我正在寻找一个具有恒定斜率的图,如下图所示:
有任何想法吗?
适合形状的模型fit<-glmer(resp.var ~ cont.var*cat.var + (1|rand.eff) , data = sample.data , poisson)
以下是一些示例数据:
structure(list(cat.var = structure(c(4L, 4L, 1L, 4L, 1L, 2L,
1L, 1L, 1L, 1L, 4L, 1L, 1L, 3L, 2L, 4L, 1L, 1L, 1L, 2L, 1L, 2L,
2L, 1L, 3L, 1L, 1L, 2L, 4L, 1L, 2L, 1L, 1L, 4L, 1L, 3L, 1L, 3L,
3L, 4L, 3L, 4L, 1L, 3L, 3L, 1L, 2L, 3L, 4L, 3L, 4L, 2L, 1L, 1L,
4L, 1L, 1L, 1L, 1L, 1L, 1L, 4L, 1L, 4L, 4L, 3L, 3L, 1L, 3L, 3L,
3L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 4L, 1L, 3L, 4L, 1L, 1L, 4L,
1L, 3L, 1L, 1L, 3L, 2L, 4L, 1L, 4L, 1L, 4L, 4L, 4L, 4L, 2L, 4L,
4L, 1L, 2L, 1L, 4L, 3L, 1L, 1L, 3L, 2L, 4L, 4L, 1L, 4L, 1L, 3L,
2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 4L, 1L,
2L, 2L, 1L, 1L, 2L, 3L, 1L, 4L, 4L, 4L, 1L, 4L, 4L, 3L, 2L, 4L,
1L, 3L, 1L, 1L, 4L, 4L, 2L, 4L, 1L, 1L, 3L, 4L, 2L, 1L, 3L, 3L,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
1L, 3L, 1L, 3L, 1L, 4L, 3L, 1L, 4L, 4L, 2L, 4L, 1L, 1L, 2L, 4L,
4L, 2L, 3L, 4L, 4L, 3L, 1L, 4L, 1L, 2L, 4L, 1L, 1L, 4L, 1L, 1L,
1L, 1L, 1L, 3L, 4L, 1L, 4L, 4L, 2L, 2L, 2L, 2L, 3L, 4L, 4L, 1L,
1L, 4L, 2L, 3L, 3L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 3L, 4L, 2L,
3L, 1L, 1L, 1L, 4L, 1L, 1L, 4L, 4L, 4L, 1L, 1L, 1L, 1L), .Label = c("A",
"B", "C", "D"), class = "factor"), cont.var = c(-0.0682900527296927,
0.546320421837542, -0.273160210918771, -0.887770685486005, 0.136580105459385,
0.75119058002662, 0.546320421837542, -0.273160210918771, -0.682900527296927,
0.136580105459385, 0.75119058002662, 0.75119058002662, 0.75119058002662,
0.341450263648464, 0.75119058002662, 0.546320421837542, 0.546320421837542,
-0.478030369107849, -0.478030369107849, -0.682900527296927, -0.682900527296927,
0.546320421837542, -0.478030369107849, -0.0682900527296927, 0.136580105459385,
0.136580105459385, 0.75119058002662, -0.478030369107849, 0.75119058002662,
-0.887770685486005, 0.136580105459385, -0.478030369107849, 0.341450263648464,
-0.682900527296927, -0.478030369107849, 0.341450263648464, -0.478030369107849,
0.546320421837542, 0.75119058002662, -0.478030369107849, -0.273160210918771,
0.546320421837542, -0.682900527296927, 0.75119058002662, -0.478030369107849,
-0.887770685486005, 0.136580105459385, -0.887770685486005, -0.0682900527296927,
-0.478030369107849, 0.546320421837542, 0.75119058002662, 0.136580105459385,
-0.273160210918771, -0.273160210918771, 0.75119058002662, -0.682900527296927,
0.136580105459385, -0.273160210918771, -0.273160210918771, 0.136580105459385,
0.136580105459385, 0.341450263648464, 0.136580105459385, -0.273160210918771,
-0.273160210918771, -0.682900527296927, -0.887770685486005, -0.0682900527296927,
0.136580105459385, -0.0682900527296927, -0.273160210918771, -0.273160210918771,
0.341450263648464, 0.75119058002662, -0.682900527296927, -0.0682900527296927,
-0.273160210918771, -0.887770685486005, -0.0682900527296927,
0.75119058002662, 0.546320421837542, 0.75119058002662, 0.75119058002662,
-0.887770685486005, 0.341450263648464, 0.75119058002662, -0.887770685486005,
0.136580105459385, -0.273160210918771, 0.546320421837542, 0.546320421837542,
-0.682900527296927, 0.75119058002662, 0.136580105459385, -0.0682900527296927,
-0.478030369107849, 0.75119058002662, -0.478030369107849, 0.341450263648464,
0.136580105459385, -0.0682900527296927, -0.478030369107849, -0.0682900527296927,
-0.0682900527296927, 0.546320421837542, -0.273160210918771, 0.75119058002662,
0.341450263648464, 0.546320421837542, -0.478030369107849, 0.136580105459385,
-0.887770685486005, -0.273160210918771, -0.273160210918771, -0.478030369107849,
-0.478030369107849, 0.75119058002662, -0.682900527296927, -0.0682900527296927,
0.546320421837542, 0.75119058002662, 0.546320421837542, 0.136580105459385,
-0.478030369107849, 0.136580105459385, 0.546320421837542, -0.478030369107849,
-0.0682900527296927, -0.0682900527296927, 0.546320421837542,
-0.273160210918771, 0.136580105459385, -0.0682900527296927, 0.75119058002662,
-0.0682900527296927, 0.546320421837542, -0.887770685486005, -0.0682900527296927,
-0.682900527296927, -0.478030369107849, -0.478030369107849, -0.682900527296927,
0.75119058002662, 0.341450263648464, -0.0682900527296927, 0.341450263648464,
-0.0682900527296927, -0.887770685486005, -0.887770685486005,
-0.273160210918771, -0.0682900527296927, 0.546320421837542, -0.0682900527296927,
-0.0682900527296927, 0.75119058002662, -0.0682900527296927, -0.273160210918771,
-0.478030369107849, 0.546320421837542, 0.546320421837542, 0.546320421837542,
0.341450263648464, 0.136580105459385, -0.478030369107849, 0.136580105459385,
0.136580105459385, 0.136580105459385, -0.478030369107849, -0.273160210918771,
-0.273160210918771, -0.273160210918771, 0.341450263648464, -0.273160210918771,
-0.0682900527296927, 0.136580105459385, 0.546320421837542, -0.478030369107849,
-0.273160210918771, 0.546320421837542, 0.546320421837542, -0.273160210918771,
-0.0682900527296927, 0.341450263648464, 0.546320421837542, -0.0682900527296927,
0.136580105459385, -0.478030369107849, 0.75119058002662, -0.478030369107849,
-0.682900527296927, -0.478030369107849, 0.136580105459385, -0.273160210918771,
-0.0682900527296927, -0.887770685486005, -0.887770685486005,
0.546320421837542, -0.273160210918771, 0.546320421837542, -0.478030369107849,
0.546320421837542, -0.0682900527296927, 0.75119058002662, -0.273160210918771,
0.546320421837542, 0.341450263648464, -0.0682900527296927, -0.0682900527296927,
-0.0682900527296927, -0.887770685486005, 0.136580105459385, -0.273160210918771,
-0.478030369107849, 0.75119058002662, 0.341450263648464, 0.546320421837542,
-0.273160210918771, 0.546320421837542, 0.75119058002662, -0.273160210918771,
0.75119058002662, 0.546320421837542, -0.273160210918771, -0.273160210918771,
0.75119058002662, -0.273160210918771, -0.0682900527296927, 0.136580105459385,
-0.478030369107849, 0.75119058002662, 0.75119058002662, -0.887770685486005,
-0.887770685486005, 0.546320421837542, -0.682900527296927, -0.887770685486005,
0.136580105459385, 0.75119058002662, 0.75119058002662, -0.478030369107849,
0.136580105459385, 0.75119058002662, -0.273160210918771, -0.682900527296927,
-0.273160210918771, 0.136580105459385, 0.546320421837542, -0.682900527296927,
-0.478030369107849, 0.136580105459385, -0.682900527296927, -0.0682900527296927,
-0.478030369107849, 0.136580105459385, -0.887770685486005, -0.273160210918771,
-0.0682900527296927, -0.273160210918771, -0.887770685486005,
0.546320421837542, 0.546320421837542, -0.478030369107849, -0.273160210918771,
-0.0682900527296927, 0.136580105459385, -0.478030369107849, 0.75119058002662,
0.341450263648464, 0.136580105459385, 0.136580105459385, 0.75119058002662,
0.136580105459385, -0.0682900527296927, 0.546320421837542, -0.0682900527296927,
-0.887770685486005, 0.75119058002662, 0.75119058002662, 0.546320421837542,
-0.887770685486005, -0.0682900527296927, -0.682900527296927,
-0.682900527296927, 0.75119058002662, 0.75119058002662, -0.478030369107849,
0.546320421837542, -0.273160210918771, 0.75119058002662, -0.0682900527296927,
0.546320421837542, -0.0682900527296927, -0.273160210918771, 0.546320421837542,
0.75119058002662, -0.0682900527296927, 0.546320421837542, -0.682900527296927,
-0.273160210918771, -0.0682900527296927, -0.478030369107849,
-0.478030369107849, 0.136580105459385, -0.273160210918771, 0.136580105459385,
0.546320421837542, 0.75119058002662, -0.273160210918771, 0.341450263648464,
-0.273160210918771, 0.136580105459385, 0.546320421837542, 0.546320421837542,
0.136580105459385, 0.136580105459385, -0.682900527296927, 0.341450263648464,
0.341450263648464, -0.273160210918771, -0.682900527296927, -0.0682900527296927,
0.75119058002662, -0.887770685486005, -0.478030369107849, -0.273160210918771,
-0.478030369107849, -0.478030369107849, 0.136580105459385, -0.478030369107849,
0.136580105459385, -0.478030369107849, 0.136580105459385, -0.0682900527296927,
-0.273160210918771, 0.136580105459385, 0.341450263648464, -0.478030369107849,
0.75119058002662, 0.136580105459385, 0.341450263648464, 0.546320421837542,
-0.887770685486005, 0.75119058002662, 0.341450263648464, -0.0682900527296927,
-0.478030369107849, 0.546320421837542, 0.136580105459385, -0.682900527296927,
-0.0682900527296927, 0.341450263648464, -0.478030369107849, -0.0682900527296927,
-0.478030369107849, -0.0682900527296927, 0.341450263648464, -0.478030369107849,
-0.682900527296927, 0.75119058002662, -0.478030369107849, -0.682900527296927,
0.341450263648464, -0.887770685486005, -0.478030369107849, 0.546320421837542,
-0.887770685486005, -0.478030369107849, -0.478030369107849, 0.341450263648464,
0.75119058002662, -0.682900527296927, 0.75119058002662, 0.75119058002662,
0.341450263648464, -0.0682900527296927, 0.546320421837542, -0.0682900527296927,
0.136580105459385, 0.136580105459385, 0.136580105459385, 0.136580105459385,
0.546320421837542, 0.546320421837542, -0.0682900527296927, 0.75119058002662,
-0.0682900527296927, -0.0682900527296927, -0.682900527296927,
-0.273160210918771, -0.682900527296927, -0.478030369107849, 0.136580105459385,
0.75119058002662, 0.546320421837542, 0.341450263648464, -0.887770685486005,
-0.0682900527296927, 0.136580105459385, 0.75119058002662, -0.273160210918771,
-0.682900527296927, 0.136580105459385, -0.478030369107849, -0.273160210918771,
-0.273160210918771, 0.136580105459385, 0.341450263648464, -0.478030369107849,
-0.0682900527296927, -0.682900527296927, 0.75119058002662, -0.273160210918771,
-0.478030369107849, -0.0682900527296927, -0.0682900527296927,
-0.273160210918771, -0.0682900527296927, -0.478030369107849,
0.75119058002662, -0.0682900527296927, 0.136580105459385, 0.546320421837542,
0.546320421837542, -0.478030369107849, -0.273160210918771, 0.546320421837542,
-0.478030369107849, -0.682900527296927, 0.75119058002662, -0.0682900527296927,
-0.682900527296927, -0.682900527296927, 0.75119058002662, 0.341450263648464,
-0.478030369107849, 0.75119058002662, 0.136580105459385, -0.887770685486005,
0.341450263648464, 0.341450263648464, 0.546320421837542, -0.273160210918771,
0.136580105459385, 0.75119058002662, -0.0682900527296927, -0.682900527296927,
-0.478030369107849, -0.478030369107849, 0.75119058002662, 0.546320421837542,
-0.478030369107849, 0.546320421837542, 0.136580105459385, -0.887770685486005,
0.75119058002662, -0.0682900527296927, 0.75119058002662, 0.75119058002662,
-0.273160210918771, -0.682900527296927, 0.546320421837542, 0.546320421837542,
-0.887770685486005, 0.75119058002662, -0.273160210918771, 0.546320421837542,
-0.0682900527296927, 0.136580105459385, 0.341450263648464, -0.478030369107849,
0.136580105459385, 0.136580105459385, -0.273160210918771, 0.546320421837542,
-0.273160210918771, -0.273160210918771, -0.273160210918771, 0.75119058002662,
-0.887770685486005, -0.887770685486005, -0.0682900527296927,
-0.478030369107849, -0.0682900527296927, 0.75119058002662, -0.273160210918771,
0.136580105459385, -0.478030369107849, -0.273160210918771, 0.136580105459385,
0.75119058002662, 0.546320421837542, -0.478030369107849, -0.273160210918771,
-0.273160210918771, 0.136580105459385, -0.273160210918771, -0.0682900527296927,
0.75119058002662, 0.136580105459385), resp.var = c(2L, 1L, 0L,
1L, 0L, 0L, 0L, 0L, 0L, 1L, 3L, 1L, 0L, 1L, 0L, 1L, 2L, 0L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0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, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L,
37L, 37L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L, 40L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L,
43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L)), .Names = c("cat.var",
"cont.var", "resp.var", "rand.eff"), row.names = c(NA, 500L), class = "data.frame")
最佳答案
这是各种答案(顺便说一下,您在上面的数据框中缺少一些引号,必须手动修复...)
拟合模型:
library(lme4)
fit <- glmer(resp.var ~ cont.var:cat.var + (1|rand.eff) ,
data = sample.data , poisson)
cont.var==0
处具有相同的值。您的意思是
cont.var*cat.var
吗?
library(ggplot2)
theme_update(theme_bw()) ## set white rather than gray background
ggplot(sample.data,aes(cont.var,resp.var,linetype=cat.var))+
geom_smooth(method="lm",se=FALSE)
ggplot(sample.data,aes(cont.var,resp.var,colour=cat.var))+
stat_sum(aes(size=..n..),alpha=0.5)+
geom_smooth(method="glm",family="poisson")
lme4
的开发(r-forge)版本,其中有一个
predict
方法:
predframe <- with(sample.data,
expand.grid(cat.var=levels(cat.var),
cont.var=seq(min(cont.var),
max(cont.var),length=51)))
REform=NA
),在线性预测变量 (logit) 尺度上进行预测(这是您在绘图上获得直线的唯一方法)
predframe$pred.logit <- predict(fit,newdata=predframe,REform=NA)
minmaxvals <- range(sample.data$cont.var)
ggplot(predframe,aes(cont.var,pred.logit,linetype=cat.var))+geom_line()+
geom_point(data=subset(predframe,cont.var %in% minmaxvals),
aes(shape=cat.var))
predframe$pred <- predict(fit,newdata=predframe,REform=NA,type="response")
ggplot(predframe,aes(cont.var,pred,linetype=cat.var))+geom_line()+
geom_point(data=subset(predframe,cont.var %in% minmaxvals),
aes(shape=cat.var))
关于R:具有连续变量和分类变量的 GLMM 交互图 (lme4),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10457756/
我正在使用线性混合效应模型来确定两个变量随时间变化的关系,模型 - data(mtcars) # linear mixed effects model mlme data.frame(conf) E
我正在用 R 开发一个简单的模型: fit<-lme(x~y, data, random=~1|subject) 但我一直收到这个错误: Error in na.fail.default(list(h
在 R 的 nlme 包中的 lme() 函数的标准示例中: fm2 1) ...) 也许能够打印固定效应参数的摘要对您有用......? printCoefmat(summary(fm2)$tTa
我如何在线性混合模型中提取系数(b0 和 b1)及其各自的标准误差(图),例如: Better fits for a linear model 使用相同的数据集(df),以及拟合模型(fitL1):我
我正在 nlme 包中通过 REML 拟合线性混合效果模型。这些是对我有用的代码: # Linear mixed-effects model fit by REML (intercept and no
背景 我正在尝试根据某些参数在函数中拟合混合模型。如果我想使用 contrast来自 library(contrast)我必须使用变通方法,如 contrast使用 call来自 lme 的插槽确定
我有示例数据和模型 x coef(model.mx) (Intercept) x 1 54.88302 19.18001 2 54.88298 19.18000 3
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 3 年前。 Improve
如何为以下模型初始化非结构化协方差矩阵? y5 个科目。 关于r - 在 lme 中初始化协方差结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflo
我有一个包含 5 个变量的数据框:批处理/晶圆/序列号/电压/放大倍数。在此数据框中,有 1020 个按 Serial_number 分组的子集。每个子集都有一定数量的测量数据点(电压放大)。 我用
我必须对使用 nlme 包中的 lme() 函数制作的多个大型模型的置信区间进行一些转换。我正在使用 intervals() 函数来获取间隔,但是无法将其转换为数据帧。有什么方法可以将其变成可访问的数
我开始用 nlme 编写一个构建线性混合模型的函数。我遇到错误:Error in eval(expr, envir, enclos) : object 'value' not found,我认为这是由
我有数据,其中“飞行速度”是一个响应变量,group(实验/控制),test(第一/第二),FL (燃料负荷,来自瘦体重的百分比:从 0 到 ~25%),wing(机翼长度,以毫米为单位)。由于我们对
我已经成功地拟合了一个线性混合效应模型,我正在寻找为各个组提取随机效应分量。我知道可以使用提取随机效应的完整列表 random.effects(model) 然后 print(random.effec
我有以下型号 x <- rep(seq(0, 100, by=1), 10) y <- 15 + 2*rnorm(1010, 10, 4)*x + rnorm(1010, 20, 100) id
4 个 hive 配备了传感器,用于收集 hive 内的温度、湿度、压力和分贝。这些是响应变量。 治疗是wifi暴露,实验组从第1天到第20天,然后从第35-45天再次暴露在wifi下,直到第54天收
如果有人能帮我解决这个问题,我会很高兴。我有重复测量设计的数据,我们测试了鸟类感染前后的 react ( time.dep )( exper )。我们还有FL (燃料负荷,瘦体重百分比),脂肪评分和组
我是这方面的新手,所以我无法确定这是否愚蠢。 基本上,我想在一个巨大的数据集中的所有连续变量之间做成对的混合效应模型。显而易见的替代方案是简单的 spearman 相关,但我有我的理由,要解释我为什么
有没有办法在 nlme 包 lme 模型中获得随机项的方差? Random effects: Formula: ~t | UID Structure: General positive-defin
我目前正在阅读 Andy Field 的书,使用 R 发现统计数据。第 14 章是关于混合建模的,他使用了 lme来自 nlme 的函数包。 他使用快速约会数据创建的模型是这样的: speedDate
我是一名优秀的程序员,十分优秀!