-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWrite GLMM Table
54 lines (48 loc) · 1.26 KB
/
Write GLMM Table
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
library(foreign)
library(pscl)
require(ffbase)
require(LaF)
require(ETLUtils)
library(xtable)
require(biglm)
library(psych)
library(xtable)
cleardata<-function(input){
names<-rownames(input)
final<-matrix("",nrow=nrow(input)*2,ncol=2)
j=1
for(i in 1:nrow(input)){
st<-paste("(",round(as.numeric(as.matrix(input[i,2])),digits=3),",",round(as.numeric(as.matrix(input[i,3])),digits=3),")",sep="")
if(!is.na(input[i,5])){
if(as.numeric(input[i,5])<=0.001){
coe<-paste(round(as.numeric(input[i,1]),digits=3),"***",sep="")
}
if(as.numeric(input[i,5]<=0.01&as.numeric(input[i,5])>0.001 )){
coe<-paste(round(as.numeric(input[i,1]),digits=3),"**",sep="")
}
if(as.numeric(input[i,5]<=0.05&&as.numeric(input[i,5])>0.01)){
coe<-paste(round(as.numeric(input[i,1]),digits=3),"*",sep="")
}
if(as.numeric(input[i,5]<=0.1&&as.numeric(input[i,5])>0.05)){
coe<-paste(round(as.numeric(input[i,1]),digits=3),"+",sep="")
}
if(as.numeric(input[i,5])>0.1){
coe<-round(as.numeric(input[i,1]),digits=3)}
}else{
coe<-"NA"
}
final[j,1]<-names[i]
final[j,2]<-coe
final[j+1,2]<-st
j<-j+2
}
return(final)
}
mm<-summary(results)
print.xtable(xtable(
rbind(data.frame(cleardata(mm$solutions)),
data.frame(cbind("Obs.",nrow(fulldata))),
data.frame(cbind("DIC",mm$DIC ))
)
)
,type="html",file="numfundingzipsubset1.html")