-
Notifications
You must be signed in to change notification settings - Fork 3
/
Untitled.R
48 lines (48 loc) · 898 Bytes
/
Untitled.R
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
# library(nlme)
# per = c()
# for(i in 1:100){
# id = c(rep(1,10), 2:100)
# y = rnorm(length(id))
# y[1:10] = rnorm(10, sd = 0.5)
# mm = lme(y~1, random = ~1|id)
#
# x = as.numeric(VarCorr(mm)[1:2])
# per[i] = x[1]/sum(x)
# }
#
#
# library(nlme)
# per2 = c()
# for(i in 1:100){
# id = c(rep(1,10), 2:100)
# y = rnorm(length(id))
# y[1:10] = rnorm(10, sd = 0.5)+20
# mm = lme(y~1, random = ~1|id)
#
# x = as.numeric(VarCorr(mm)[1:2])
# per2[i] = x[1]/sum(x)
# }
#
#
#
#
# # per2
# per2 = c()
# for(i in 1:100){
# id = c(rep(1,100), 2:1000)
# y = rnorm(length(id))
# y[1:100] = rnorm(100, sd = 0.5)
# mm = lme(y~1, random = ~1|id)
#
# x = as.numeric(VarCorr(mm)[1:2])
# per2[i] = x[1]/sum(x)
# }
#
#
#
# # per2
# median(per)
# median(per2)
# # median(per3)
#
# boxplot( (per), (per2), ylab = 'ICC', xlab = "small vs large", sub = "sample size")