问题描述
我正在尝试在Milliken(https://sci-hub.tw/10.1016/s0169-7161(03)22007-1,第8节)的一篇论文中将分析结果从SAS代码复制到R。老实说,我很沮丧。这是一个分割图重复测量设计,其中相关结构是复合对称结构。下面是数据和SAS代码及其结果。
数据
Argument of type 'MouseEvent' is not assignable to parameter of type 'MouseEvent<{},MouseEvent>'.
SAS代码
library(magrittr)
library(tidyr)
library(dplyr)
dta <- data.frame(
tmp = c(rep(900,3),rep(1000,rep(1100,3)),posit = rep(c("top","mid","bot"),lot_1 = c(189,211,178,213,220,197,194,212,189),lot_2 = c(195,206,162,199,230,198,215,208,193),lot_3 = c(183,210,173,189,228,202,201,180),lot_4 = c(187,223,181,183,221,168,232,192),lot_5 = c(173,191,149,151,190,182)
)
dta <- dta %>%
tidyr::pivot_longer(.,cols = c(lot_1,lot_2,lot_3,lot_4,lot_5),names_to = "Lot") %>%
dplyr::mutate(Lot = as.factor(Lot),tmp = as.factor(tmp),lot_tmp = as.factor(paste0(Lot,"-",tmp)))
R代码尝试
proc mixed data = dta cl covtest ic;
class Posit temp lot;
model thick = temp Posit Posit*temp/ddfm = kr; random lot;
repeated posit/type = cs subject = lot*temp r rcorr
在这一点上,我仍然停留在如何向
## this works but isn't doing the same thing as above
library(nlme)
m1 <- lme(
value ~ temp + posit + temp:posit,random = ~ 1 | lot,correlation = corCompSymm(form=~1|lot),data = dta,method = "REML"
)
因素添加重复结构的问题上。
谢谢您的帮助!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)