五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

R語言在不同樣本量下的Little's MCAR檢驗

2021-03-08 09:23 作者:拓端tecdat  | 我要投稿

原文鏈接:http://tecdat.cn/?p=10134

我進(jìn)行一個小型仿真,以在不同樣本量下測試Little的MCAR檢驗1。我可以研究線性回歸中的異方差。我能夠找到一些使用Little's MCAR檢驗的小樣本研究人員的例子,因此我進(jìn)行了仿真。

  1. library(BaylorEdPsych)

  2. library(simglm)

  3. library(ggplot2)

  4. library(dplyr)

  5. library(mice)

  6. fixed <- ~1 + age + income

  7. fixed_param <- c(2, 0.3, 1.3)

  8. cov_param <- list(dist_fun = c('rnorm', 'rnorm'),

  9. var_type = c("single", "single"),

  10. opts = list(list(mean = 0, sd = 4),

  11. list(mean = 0, sd = 3)))

  1. ggplot(little.mcar.p, aes(x = n, y = p)) + geom_boxplot() +

  2. geom_crossbar(aes(ymin = q025, y = q05, ymax = q075), data = summarise(

  3. group_by(little.mcar.p, n), q025 = quantile(p, .025, na.rm = TRUE),

  4. q05 = quantile(p, .05, na.rm = TRUE), q075 = quantile(p, .075, na.rm = TRUE)

  5. )) +

  6. geom_hline(yintercept = .05) +

  7. scale_y_continuous(breaks = seq(0, 1, .05), limits = c(0, 1)) +

  8. labs(x = "Sample size", y = "p-value",

  9. title = "Little's MCAR test for data that are MCAR",

  10. subtitle = "2000 replications",

  11. caption = paste(paste("For the narrow boxes, going from top to bottom, lines",

  12. "represent 7.5th, 5th and 2.5th percentiles of p-values."),

  13. "Test maintains nominal error rate across wide range of sample sizes.",

  14. sep = "\n"))

?

數(shù)據(jù)是MCAR

  1. ggplot(little.mcar.p.mar, aes(x = n, y = p)) + geom_boxplot() +

  2. geom_crossbar(aes(ymin = q925, y = q95, ymax = q975), data = summarise(

  3. group_by(little.mcar.p.mar, n), q925 = quantile(p, .925, na.rm = TRUE),

  4. q95 = quantile(p, .95, na.rm = TRUE), q975 = quantile(p, .975, na.rm = TRUE)

  5. ), linetype = 2) +

  6. geom_hline(yintercept = .05) +

  7. scale_y_continuous(breaks = seq(0, 1, .05), limits = c(0, 1)) +

  8. labs(x = "Sample size", y = "p-value",

  9. title = "Little's MCAR test for data that are MAR",

  10. subtitle = "2000 replications",

  11. caption = paste(paste("For the dashed boxes, going from top to bottom, lines",

  12. "represent 97.5th, 95th and 92.5th percentiles of p-values."),

  13. "Test only maintains nominal error rate around sample size of 120.",

  14. sep = "\n"))

數(shù)據(jù)是MAR

回歸接近完美(沒有多重共線性)。

?

R語言在不同樣本量下的Little's MCAR檢驗的評論 (共 條)

分享到微博請遵守國家法律
长海县| 家居| 竹溪县| 广州市| 遵化市| 贵阳市| 宝清县| 吴川市| 阿勒泰市| 饶河县| 陇南市| 额尔古纳市| 宜兰县| 兰西县| 江陵县| 兰坪| 吕梁市| 同江市| 福建省| 莱阳市| 蓝山县| 罗定市| 瓮安县| 施甸县| 黎平县| 金堂县| 雷州市| 湖南省| 溧水县| 扎鲁特旗| 呼伦贝尔市| 汝州市| 大田县| 义乌市| 景德镇市| 安吉县| 密云县| 大荔县| 中方县| 常熟市| 洪洞县|