我想添加变量dat2:
concreteness familiarity typicality
amoeba 3.60 1.30 1.71
bacterium 3.82 3.48 2.13
leech 5.71 1.83 4.50
Run Code Online (Sandbox Code Playgroud)
致dat1:
ID variable value
1 1 amoeba 0
2 2 amoeba 0
3 3 amoeba NA
251 1 bacterium 0
252 2 bacterium 0
253 3 bacterium 0
501 1 leech 1
502 2 leech 1
503 3 leech 0
Run Code Online (Sandbox Code Playgroud)
给出以下输出:
X ID variable value concreteness familiarity typicality
1 1 1 amoeba 0 3.60 1.30 1.71
2 2 2 amoeba …Run Code Online (Sandbox Code Playgroud) 我需要转换以下(简化)数据集,由以下代码创建:
structure(list(W1.1 = structure(c(1L, NA, NA), .Names = c("case1",
"case2", "case3"), .Label = "1", class = "factor"), R1.1 = structure(c(1L,
NA, NA), .Names = c("case1", "case2", "case3"), .Label = "2", class = "factor"),
W1.2 = structure(c(NA, 1L, NA), .Names = c("case1", "case2",
"case3"), .Label = "1", class = "factor"), R1.2 = structure(c(NA,
1L, NA), .Names = c("case1", "case2", "case3"), .Label = "1", class = "factor"),
W2.1 = structure(c(NA, 1L, NA), .Names = c("case1", "case2",
"case3"), .Label = "1", class = …Run Code Online (Sandbox Code Playgroud) 我正在工作R,有一个名为的包lme4.
执行模型:
lmer.rasch <- lmer(Response ~ item -1 + (1|STIDSTD),family=binomial, data=exampledata)
Run Code Online (Sandbox Code Playgroud)
让我在控制台输出,如帖子末尾所示.我想复制这个,似乎是一个表,excel,或最终说,识别单独的列和行.Ctrl-C/Ctrl-V到excel会识别行,但不识别列.
使用write.csv(lmer.rasch)给出错误:
as.data.frame.default(x [[i]],optional = TRUE)中的错误:无法将类的结构("mer",package ="lme4")强制转换为data.frame
这是包中的问题,还是我错误地使用write函数的一般问题,或者R实际上没有将此输出分成列?
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
variableamoeba -2.7529 0.3000 -9.175 < 2e-16 ***
variablebacterium -2.3937 0.2244 -10.668 < 2e-16 ***
variableleech 0.5578 0.1693 3.294 0.000987 ***
variablecentipede 1.7012 0.1909 8.911 < 2e-16 ***
variablelizard -4.1836 0.4090 -10.229 < 2e-16 ***
variabletapeworm -1.3697 0.1841 -7.439 1.01e-13 ***
variablehead lice 1.1803 0.1777 6.643 3.07e-11 *** …Run Code Online (Sandbox Code Playgroud)