Amalia Carolina Guaymas Canavire
2013-Oct-30 14:44 UTC
[R-es] disculpe las molestias ...ayuda con MICE
Saludo gente, antes que nada gracias por la ayuda que puedan aportarme, soy iniciante en R, estoy usando el paquete Mice para realizar imputaciones múltiples sobre variables en su mayoría categóricas. El problema está que cuando expresó este comando imp <- mice(dataset,method="polr",maxit=1) donde el dataset es un data.frame me tirá este error : iter imp variable 1 1 pial1a pial2 pial3a pial3b pial3cError en nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : too many (1068) weights buscando en foros encontre que debo modificar el nnet, concretamente maxNWts indicando un valor mayor al valor con problema, para modificar eso se me ocurre usar mice.impute.polyreg(dataset x=NULL, nnet.maxit 100,nnet.trace = FALSE, nnet.maxNWts = 1500) pero el problema que me piden X que representa Matrix (n x p) of complete covariates, pero al ser las vbles categóricas, no me queda claro como estimarla. En si alguna ayuda para poder solucionar este problema en donde lo que se busca en poder aplicar regresión logística y por ello me veo con el problema del nnet. GRACIAS: codigo que uso x <- read.table("C:/Omnibus_Jan_2013nom.txt", header=TRUE, sep=",", na.strings = c ("NA", ""),quote="\"", dec=",") dataset <- data.frame(x) library(mice) md.pattern(x) md.pairs(x) imp <- mice(dataset,method="polyreg",maxit=5) mice.impute.polyreg(dataset, nnet.maxit = 100,nnet.trace = FALSE, nnet.maxNWts = 1500) traceback() MI TABLA structure(list(ï..psraid = c(202517L, 202518L, 202520L, 202523L, 202527L, 202537L, 202543L, 202544L, 202551L, 202566L, 202570L, 202571L, 202606L, 202619L, 202624L, 202629L, 202631L, 202632L, 202633L, 202648L, 202657L, 202663L, 202676L, 202683L, 202685L, 202706L, 202708L, 202709L, 202710L, 202734L, 202735L, 202736L, 202737L, 202746L, 202753L, 202764L, 202769L, 202772L, 202773L, 202776L, 202811L, 202816L, 202824L, 202832L, 202842L, 202845L, 202848L, 202856L, 202858L, 202861L), sample = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Cell", "Landline"), class = "factor"), state structure(c(31L, 38L, 24L, 12L, 32L, 9L, 47L, 12L, 9L, 19L, 32L, 39L, 12L, 22L, 24L, 7L, 14L, 10L, 14L, 26L, 4L, 21L, 24L, 13L, 17L, 16L, 44L, 8L, 16L, 4L, 9L, 28L, 44L, 10L, 37L, 25L, 26L, 4L, 33L, 4L, 4L, 12L, 4L, 26L, 36L, 27L, 6L, 45L, 4L, 4L), .Label = c(" 1", " 4", " 5", " 6", " 8", " 9", "Delaware", "District of Columbia", "Florida", "Georgia", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin"), class = "factor"), cregion = structure(c(2L, 2L, 1L, 1L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L, 4L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, 2L, 4L, 1L, 4L, 1L, 4L, 4L, 1L, 4L, 1L, 4L, 4L, 2L, 4L, 4L, 4L ), .Label = c("Midwest", "Northeast", "South", "West"), class = "factor"), usr = structure(c(2L, 2L, 1L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, 3L, 2L, 1L, 3L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 3L, 3L, 3L, 1L, 2L, 2L, 3L, 2L, 1L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 1L, 2L, 1L, 3L, 2L, 3L, 2L, 2L, 2L), .Label = c("Rural", "Suburban", "Urban"), class = "factor"), pial1a structure(c(NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_), .Label = c("No", "Yes"), class = "factor"), pial1b = structure(c(2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, 3L, 1L), .Label = c("(DO NOT READ) Don't know", "No", "Yes" ), class = "factor"), pial1c = structure(c(3L, 3L, 3L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 3L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 4L, 3L, 3L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", "No", "Yes"), class = "factor"), pial1d = structure(c(1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L), .Label = c("No", "Yes"), class = "factor"), pial1e = structure(c(2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L), .Label = c("No", "Yes"), class = "factor"), pial2 = structure(c(1L, 1L, 1L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 2L, 3L, 1L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 3L, 3L, 3L, 1L, 1L), .Label = c("No, not a smartphone", "Not sure/Don't know", "Yes, smartphone"), class = "factor"), pial3a = structure(c(5L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 5L, 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 4L, 5L, 4L, 5L, 4L, 1L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", "Have done this but not in last 30 days (VOL.)", "No, have not done this", "Yes, have done this"), class = "factor"), pial3b = structure(c(4L, 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 5L, 4L, 5L, 5L, 5L, 3L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 3L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", "Cell phone is not able to do this (VOL.)", "No, have not done this", "Yes, have done this"), class = "factor"), pial3c = structure(c(5L, 5L, 5L, 5L, 5L, 6L, 6L, 3L, 5L, 6L, 5L, 5L, 6L, 5L, 3L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 3L, 5L, 5L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 3L, 5L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", "Cell phone is not able to do this (VOL.)", "Have done this but not in last 30 days (VOL.)", "No, have not done this", "Yes, have done this"), class = "factor"), pial4 = structure(c(NA, NA, NA, NA, NA, 2L, 3L, NA, NA, 5L, NA, NA, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, NA, NA, 3L, 5L, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 5L, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, 5L, 6L, 2L, NA, NA), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", "No, did not purchase", "Yes, purchased at another store", "Yes, purchased at store", "Yes, purchased online"), class = "factor"), employ = structure(c(2L, 2L, 4L, 2L, 4L, 2L, 3L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 4L, 2L, 4L, 3L, 2L, 3L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, 2L, 4L, 2L, 4L, 4L, 2L, 4L, 2L, 2L, 3L, 4L), .Label = c("(DO NOT READ) Don’t know/Refused", "Employed full-time", "Employed part-time", "Not employed" ), class = "factor"), par = structure(c(2L, 2L, 2L, 3L, 1L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L ), .Label = c("(DO NOT READ) Don’t know/Refused", "No", "Yes"), class = "factor"), sex = structure(c(1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L), .Label = c("Female", "Male"), class = "factor"), age = structure(c(42L, 46L, 49L, 16L, 37L, 12L, 22L, 40L, 6L, 17L, 36L, 8L, 10L, 4L, 31L, 12L, 16L, 41L, 8L, 11L, 9L, 8L, 61L, 21L, 45L, 12L, 32L, 18L, 25L, 48L, 34L, 38L, 46L, 26L, 51L, 50L, 11L, 1L, 5L, 1L, 46L, 44L, 46L, 2L, 8L, 9L, 12L, 17L, 31L, 44L), .Label = c("(DO NOT READ) Refused", "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", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "92"), class = "factor"), educ2 = structure(c(3L, 3L, 9L, 7L, 7L, 2L, 3L, 2L, 6L, 6L, 1L, 3L, 2L, 9L, 4L, 7L, 2L, 3L, 9L, 3L, 9L, 3L, 7L, 8L, 3L, 3L, 3L, 7L, 3L, 4L, 4L, 7L, 9L, 3L, 3L, 7L, 3L, 2L, 9L, 2L, 6L, 3L, 2L, 3L, 7L, 3L, 2L, 2L, 2L, 7L), .Label = c("Don't know/Refused (VOL.)", "Four year college or university degree/Bachelor’s degree (e.g., BS, BA, AB)", "High school graduate (Grade 12 with diploma or GED certificate)", "High school incomplete (Grades 9-11 or Grade 12 with NO diploma)", "Less than high school (Grades 1-8 or no formal schooling)", "Postgraduate or professional degree, including master’s, doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)", "Some college, no degree (includes some community college)", "Some postgraduate or professional schooling, no postgraduate degree", "Two year associate degree from a college or university"), class "factor"), hisp = structure(c(2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("(DO NOT READ) Don’t know/Refused", "No", "Yes"), class = "factor"), race = structure(c(7L, 7L, 7L, 7L, 5L, 7L, 7L, 7L, 3L, 2L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 3L, 4L, 7L, 3L, 7L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 5L, 3L, 7L, 7L, 7L, 7L), .Label = c("(DO NOT READ) Don’t know/Refused", "Asian or Pacific Islander", "Black or African-American", "Mixed race", "Native American/American Indian", "Other (SPECIFY)", "White"), class = "factor"), inc = structure(c(8L, 6L, 10L, 7L, 1L, 10L, 6L, 8L, 9L, 7L, 10L, 2L, 7L, 4L, 2L, 6L, 9L, 3L, 4L, 1L, 3L, 10L, 5L, 8L, 5L, 5L, 3L, 4L, 3L, 1L, 4L, 3L, 6L, 1L, 10L, 4L, 7L, 1L, 2L, 6L, 9L, 5L, 4L, 5L, 1L, 5L, 5L, 7L, 8L, 2L), .Label = c(" 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", "(DO NOT READ) Don’t know/Refused" ), class = "factor"), weight = c(2.9024390244, 2.3414634146, 1, 3.6097560976, 3.0243902439, 4.3170731707, 6.6585365854, 3.6341463415, 1.3170731707, 2.8292682927, 2.4390243902, 2.4146341463, 2.9268292683, 4.8292682927, 7.1463414634, 7.1463414634, 2.3658536585, 4.487804878, 1.756097561, 2.756097561, 5.1707317073, 1.9268292683, 2.8780487805, 2.2195121951, 2.3414634146, 7.1463414634, 7.1463414634, 7.1463414634, 2.6097560976, 2.4634146341, 5.6097560976, 4.5365853659, 2.487804878, 5.8780487805, 4.0243902439, 2.0731707317, 6.512195122, 3.7804878049, 1.756097561, 1.1951219512, 1.2682926829, 1.9024390244, 1.5365853659, 1.6097560976, 1.1463414634, 3.6829268293, 7.1463414634, 4.7317073171, 2.2195121951, 1.5609756098), standwt = c(0.9676919303, 0.7806590362, 0.3334064634, 1.2035160141, 1.0083512551, 1.4393400979, 2.2199991341, 1.2116478791, 0.4391207078, 0.9432963354, 0.813186496, 0.8050546311, 0.9758237952, 1.6101092621, 2.3826364333, 2.3826364333, 0.7887909011, 1.4962631527, 0.5854942771, 0.9189007405, 1.7239553715, 0.6424173318, 0.9595600653, 0.7399997114, 0.7806590362, 2.3826364333, 2.3826364333, 2.3826364333, 0.8701095507, 0.821318361, 1.8703289408, 1.5125268826, 0.8294502259, 1.9597794554, 1.3417577184, 0.6912085216, 2.1712079444, 1.2604390688, 0.5854942771, 0.398461383, 0.4228569779, 0.6342854669, 0.5123074925, 0.5367030874, 0.3821976531, 1.227911609, 2.3826364333, 1.5775818023, 0.7399997114, 0.5204393574)), .Names c("ï..psraid", "sample", "state", "cregion", "usr", "pial1a", "pial1b", "pial1c", "pial1d", "pial1e", "pial2", "pial3a", "pial3b", "pial3c", "pial4", "employ", "par", "sex", "age", "educ2", "hisp", "race", "inc", "weight", "standwt"), row.names = 954:1003, class = "data.frame")> dput(tail(dataset, 50))-- *************** * :) *sonrei que te queda lindo :):):):): **amy **cgc ************************** * [[alternative HTML version deleted]]
Amalia, No obtengo tus resultados. Corrí tus formulas y datos y el resultado es x <- structure(list(ï..psraid = c(202517L, 202518L, 202520L, 202523L, + 202527L, 202537L, 202543L, 202544L, 202551L, 202566L, 202570L, + 202571L, 202606L, 202619L, 202624L, 202629L, 202631L, 202632L, + 202633L, 202648L, 202657L, 202663L, 202676L, 202683L, 202685L, + 202706L, 202708L, 202709L, 202710L, 202734L, 202735L, 202736L, + 202737L, 202746L, 202753L, 202764L, 202769L, 202772L, 202773L, + 202776L, 202811L, 202816L, 202824L, 202832L, 202842L, 202845L, + 202848L, 202856L, 202858L, 202861L), sample = structure(c(1L, + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, + 1L), .Label = c("Cell", "Landline"), class = "factor"), state + structure(c(31L, + 38L, 24L, 12L, 32L, 9L, 47L, 12L, 9L, 19L, 32L, 39L, 12L, 22L, + 24L, 7L, 14L, 10L, 14L, 26L, 4L, 21L, 24L, 13L, 17L, 16L, 44L, + 8L, 16L, 4L, 9L, 28L, 44L, 10L, 37L, 25L, 26L, 4L, 33L, 4L, 4L, + 12L, 4L, 26L, 36L, 27L, 6L, 45L, 4L, 4L), .Label = c(" 1", " 4", + " 5", " 6", " 8", " 9", "Delaware", "District of Columbia", "Florida", + "Georgia", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", + "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", + "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", + "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", + "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", + "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", + "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", + "Wisconsin"), class = "factor"), cregion = structure(c(2L, 2L, + 1L, 1L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 3L, 1L, 3L, + 1L, 1L, 4L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, + 2L, 4L, 1L, 4L, 1L, 4L, 4L, 1L, 4L, 1L, 4L, 4L, 2L, 4L, 4L, 4L + ), .Label = c("Midwest", "Northeast", "South", "West"), class = "factor"), + usr = structure(c(2L, 2L, 1L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, + 3L, 2L, 1L, 3L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, + 3L, 3L, 3L, 1L, 2L, 2L, 3L, 2L, 1L, 2L, 2L, 2L, 2L, 3L, 2L, + 2L, 1L, 2L, 1L, 3L, 2L, 3L, 2L, 2L, 2L), .Label = c("Rural", + "Suburban", "Urban"), class = "factor"), pial1a + structure(c(NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, + NA_integer_, NA_integer_, NA_integer_, NA_integer_), .Label = c("No", + "Yes"), class = "factor"), pial1b = structure(c(2L, 2L, 2L, + 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, + 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, + 3L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, + 3L, 1L), .Label = c("(DO NOT READ) Don't know", "No", "Yes" + ), class = "factor"), pial1c = structure(c(3L, 3L, 3L, 2L, + 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 3L, + 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, + 3L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 4L, 3L, + 3L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", + "No", "Yes"), class = "factor"), pial1d = structure(c(1L, + 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, + 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, + 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, + 2L, 2L, 2L, 1L), .Label = c("No", "Yes"), class = "factor"), + pial1e = structure(c(2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, + 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, + 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, + 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L), .Label = c("No", + "Yes"), class = "factor"), pial2 = structure(c(1L, 1L, 1L, + 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 2L, + 3L, 1L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 1L, 2L, 1L, 1L, 1L, + 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 3L, 3L, 3L, + 1L, 1L), .Label = c("No, not a smartphone", "Not sure/Don't know", + "Yes, smartphone"), class = "factor"), pial3a = structure(c(5L, + 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 5L, + 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, + 4L, 5L, 4L, 4L, 4L, 5L, 4L, 5L, 4L, 1L, 4L, 5L, 5L, 5L, 5L, + 5L, 5L, 5L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) + Refused", + "Have done this but not in last 30 days (VOL.)", "No, have not done + this", + "Yes, have done this"), class = "factor"), pial3b = structure(c(4L, + 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 5L, 4L, 5L, 5L, 5L, 3L, 4L, + 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, + 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, + 5L, 5L, 3L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) + Refused", + "Cell phone is not able to do this (VOL.)", "No, have not done this", + "Yes, have done this"), class = "factor"), pial3c = structure(c(5L, + 5L, 5L, 5L, 5L, 6L, 6L, 3L, 5L, 6L, 5L, 5L, 6L, 5L, 3L, 5L, + 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 3L, + 5L, 5L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, + 6L, 6L, 3L, 5L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) + Refused", + "Cell phone is not able to do this (VOL.)", "Have done this but not in + last 30 days (VOL.)", + "No, have not done this", "Yes, have done this"), class = "factor"), + pial4 = structure(c(NA, NA, NA, NA, NA, 2L, 3L, NA, NA, 5L, + NA, NA, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, NA, NA, 3L, 5L, + NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 5L, 5L, NA, NA, NA, + NA, NA, NA, NA, 3L, 5L, 6L, 2L, NA, NA), .Label = c("(DO NOT READ) + Don't know", + "(DO NOT READ) Refused", "No, did not purchase", "Yes, purchased at + another store", + "Yes, purchased at store", "Yes, purchased online"), class "factor"), + employ = structure(c(2L, 2L, 4L, 2L, 4L, 2L, 3L, 2L, 2L, + 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 4L, 2L, 4L, 3L, 2L, + 3L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, + 2L, 4L, 2L, 4L, 4L, 2L, 4L, 2L, 2L, 3L, 4L), .Label = c("(DO NOT READ) + Don’t know/Refused", + "Employed full-time", "Employed part-time", "Not employed" + ), class = "factor"), par = structure(c(2L, 2L, 2L, 3L, 1L, + 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, + 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, + 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L + ), .Label = c("(DO NOT READ) Don’t know/Refused", + "No", "Yes"), class = "factor"), sex = structure(c(1L, 1L, + 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, + 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, + 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, + 1L, 1L, 2L), .Label = c("Female", "Male"), class = "factor"), + age = structure(c(42L, 46L, 49L, 16L, 37L, 12L, 22L, 40L, + 6L, 17L, 36L, 8L, 10L, 4L, 31L, 12L, 16L, 41L, 8L, 11L, 9L, + 8L, 61L, 21L, 45L, 12L, 32L, 18L, 25L, 48L, 34L, 38L, 46L, + 26L, 51L, 50L, 11L, 1L, 5L, 1L, 46L, 44L, 46L, 2L, 8L, 9L, + 12L, 17L, 31L, 44L), .Label = c("(DO NOT READ) Refused", + "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", "55", "56", "57", + "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", + "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", + "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", + "88", "89", "90", "92"), class = "factor"), educ2 = structure(c(3L, + 3L, 9L, 7L, 7L, 2L, 3L, 2L, 6L, 6L, 1L, 3L, 2L, 9L, 4L, 7L, + 2L, 3L, 9L, 3L, 9L, 3L, 7L, 8L, 3L, 3L, 3L, 7L, 3L, 4L, 4L, + 7L, 9L, 3L, 3L, 7L, 3L, 2L, 9L, 2L, 6L, 3L, 2L, 3L, 7L, 3L, + 2L, 2L, 2L, 7L), .Label = c("Don't know/Refused (VOL.)", + "Four year college or university degree/Bachelor’s degree (e.g., + BS, BA, AB)", + "High school graduate (Grade 12 with diploma or GED certificate)", + "High school incomplete (Grades 9-11 or Grade 12 with NO diploma)", + "Less than high school (Grades 1-8 or no formal schooling)", + "Postgraduate or professional degree, including master’s, + doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)", + "Some college, no degree (includes some community college)", + "Some postgraduate or professional schooling, no postgraduate degree", + "Two year associate degree from a college or university"), class + "factor"), + hisp = structure(c(2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, + 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, + 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, + 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("(DO NOT READ) + Don’t know/Refused", + "No", "Yes"), class = "factor"), race = structure(c(7L, 7L, + 7L, 7L, 5L, 7L, 7L, 7L, 3L, 2L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, + 7L, 7L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 3L, 4L, 7L, 3L, 7L, 6L, + 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 5L, 3L, 7L, + 7L, 7L, 7L), .Label = c("(DO NOT READ) Don’t know/Refused", + "Asian or Pacific Islander", "Black or African-American", + "Mixed race", "Native American/American Indian", "Other (SPECIFY)", + "White"), class = "factor"), inc = structure(c(8L, 6L, 10L, + 7L, 1L, 10L, 6L, 8L, 9L, 7L, 10L, 2L, 7L, 4L, 2L, 6L, 9L, + 3L, 4L, 1L, 3L, 10L, 5L, 8L, 5L, 5L, 3L, 4L, 3L, 1L, 4L, + 3L, 6L, 1L, 10L, 4L, 7L, 1L, 2L, 6L, 9L, 5L, 4L, 5L, 1L, + 5L, 5L, 7L, 8L, 2L), .Label = c(" 1", " 2", " 3", " 4", " 5", + " 6", " 7", " 8", " 9", "(DO NOT READ) Don’t know/Refused" + ), class = "factor"), weight = c(2.9024390244, 2.3414634146, + 1, 3.6097560976, 3.0243902439, 4.3170731707, 6.6585365854, + 3.6341463415, 1.3170731707, 2.8292682927, 2.4390243902, 2.4146341463, + 2.9268292683, 4.8292682927, 7.1463414634, 7.1463414634, 2.3658536585, + 4.487804878, 1.756097561, 2.756097561, 5.1707317073, 1.9268292683, + 2.8780487805, 2.2195121951, 2.3414634146, 7.1463414634, 7.1463414634, + 7.1463414634, 2.6097560976, 2.4634146341, 5.6097560976, 4.5365853659, + 2.487804878, 5.8780487805, 4.0243902439, 2.0731707317, 6.512195122, + 3.7804878049, 1.756097561, 1.1951219512, 1.2682926829, 1.9024390244, + 1.5365853659, 1.6097560976, 1.1463414634, 3.6829268293, 7.1463414634, + 4.7317073171, 2.2195121951, 1.5609756098), standwt = c(0.9676919303, + 0.7806590362, 0.3334064634, 1.2035160141, 1.0083512551, 1.4393400979, + 2.2199991341, 1.2116478791, 0.4391207078, 0.9432963354, 0.813186496, + 0.8050546311, 0.9758237952, 1.6101092621, 2.3826364333, 2.3826364333, + 0.7887909011, 1.4962631527, 0.5854942771, 0.9189007405, 1.7239553715, + 0.6424173318, 0.9595600653, 0.7399997114, 0.7806590362, 2.3826364333, + 2.3826364333, 2.3826364333, 0.8701095507, 0.821318361, 1.8703289408, + 1.5125268826, 0.8294502259, 1.9597794554, 1.3417577184, 0.6912085216, + 2.1712079444, 1.2604390688, 0.5854942771, 0.398461383, 0.4228569779, + 0.6342854669, 0.5123074925, 0.5367030874, 0.3821976531, 1.227911609, + 2.3826364333, 1.5775818023, 0.7399997114, 0.5204393574)), .Names + c("ï..psraid", + "sample", "state", "cregion", "usr", "pial1a", "pial1b", "pial1c", + "pial1d", "pial1e", "pial2", "pial3a", "pial3b", "pial3c", "pial4", + "employ", "par", "sex", "age", "educ2", "hisp", "race", "inc", + "weight", "standwt"), row.names = 954:1003, class = "data.frame")> > dataset <- data.frame(x) > library(mice)Loading required package: lattice Loading required package: MASS Loading required package: nnet mice 2.18 2013-07-31 Warning messages: 1: package ‘mice’ was built under R version 3.0.2 2: package ‘lattice’ was built under R version 3.0.2> md.pattern(x)ï..psraid sample state cregion usr pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c employ par sex age educ2 hisp race inc weight standwt pial4 pial1a 13 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 37 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 50 87> md.pairs(x)$rr ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race inc weight standwt ï..psraid 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 sample 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 state 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 cregion 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 usr 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial1a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1b 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial1c 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial1d 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial1e 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial2 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial3a 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial3b 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial3c 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial4 13 13 13 13 13 0 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 employ 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 par 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 sex 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 age 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 educ2 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 hisp 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 race 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 inc 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 weight 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 standwt 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 $rm ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race inc weight standwt ï..psraid 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 sample 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 state 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 cregion 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 usr 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial1a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1b 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial1c 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial1d 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial1e 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial2 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial3a 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial3b 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial3c 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial4 0 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 employ 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 par 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 sex 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 age 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 educ2 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 hisp 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 race 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 inc 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 weight 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 standwt 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 $mr ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race inc weight standwt ï..psraid 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sample 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cregion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 usr 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1a 50 50 50 50 50 0 50 50 50 50 50 50 50 50 13 50 50 50 50 50 50 50 50 50 50 pial1b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1d 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial4 37 37 37 37 37 0 37 37 37 37 37 37 37 37 0 37 37 37 37 37 37 37 37 37 37 employ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 par 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sex 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 age 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 educ2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hisp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 race 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 inc 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 weight 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 standwt 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $mm ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race inc weight standwt ï..psraid 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sample 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cregion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 usr 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1a 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 pial1b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1d 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial4 0 0 0 0 0 37 0 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 0 0 0 employ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 par 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sex 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 age 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 educ2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hisp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 race 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 inc 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 weight 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 standwt 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0> # en caso de que mice haga uso de números aleatorios fijo el seed paraque sea reproducible> set.seed(123) > imp <- mice(dataset,method="polyreg",maxit=5)iter imp variable 1 1 pial4 1 2 pial4 1 3 pial4 1 4 pial4 1 5 pial4 2 1 pial4 2 2 pial4 2 3 pial4 2 4 pial4 2 5 pial4 3 1 pial4 3 2 pial4 3 3 pial4 3 4 pial4 3 5 pial4 4 1 pial4 4 2 pial4 4 3 pial4 4 4 pial4 4 5 pial4 5 1 pial4 5 2 pial4 5 3 pial4 5 4 pial4 5 5 pial4> impMultiply imputed data set Call: mice(data = dataset, method = "polyreg", maxit = 5) Number of multiple imputations: 5 Missing cells per column: ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par 0 0 0 0 0 50 0 0 0 0 0 0 0 0 37 0 0 sex age educ2 hisp race inc weight standwt 0 0 0 0 0 0 0 0 Imputation methods: ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" sex age educ2 hisp race inc weight standwt "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" VisitSequence: pial4 15 PredictorMatrix: ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race inc weight standwt ï..psraid 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sample 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 state 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cregion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 usr 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1d 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial1e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3b 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial3c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 pial4 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 employ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 par 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sex 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 age 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 educ2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hisp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 race 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 inc 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 weight 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 standwt 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Random generator seed value: NA> sessionInfo()R version 3.0.1 (2013-05-16) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Spanish_Argentina.1252 LC_CTYPE=Spanish_Argentina.1252 LC_MONETARY=Spanish_Argentina.1252 LC_NUMERIC=C [5] LC_TIME=Spanish_Argentina.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] mice_2.18 nnet_7.3-7 MASS_7.3-29 lattice_0.20-24 devtools_1.3 loaded via a namespace (and not attached): [1] digest_0.6.3 evaluate_0.5.1 grid_3.0.1 httr_0.2 memoise_0.1 parallel_3.0.1 RCurl_1.95-4.1 rpart_4.1-3 stringr_0.6.2 tools_3.0.1 whisker_0.3-2 Espero te sea de utilidad, Daniel Merino El 30 de octubre de 2013 11:44, Amalia Carolina Guaymas Canavire < acarolinagc@gmail.com> escribió:> Saludo gente, antes que nada gracias por la ayuda que puedan aportarme, soy > iniciante en R, estoy usando el paquete Mice para realizar imputaciones > múltiples sobre variables en su mayoría categóricas. El problema está que > cuando expresó este comando imp <- mice(dataset,method="polr",maxit=1) > donde el dataset es un data.frame me tirá este error : > > iter imp variable > 1 1 pial1a pial2 pial3a pial3b pial3cError en nnet.default(X, Y, > w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : > too many (1068) weights > > buscando en foros encontre que debo modificar el nnet, concretamente > maxNWts indicando un valor mayor al valor con problema, para modificar eso > se me ocurre usar mice.impute.polyreg(dataset x=NULL, nnet.maxit > 100,nnet.trace = FALSE, nnet.maxNWts = 1500) pero el problema que me piden > X que representa Matrix (n x p) of complete covariates, pero al ser las > vbles categóricas, no me queda claro como estimarla. En si alguna ayuda > para poder solucionar este problema en donde lo que se busca en poder > aplicar regresión logística y por ello me veo con el problema del nnet. > GRACIAS: > > codigo que uso > x <- read.table("C:/Omnibus_Jan_2013nom.txt", header=TRUE, sep=",", > na.strings = c ("NA", ""),quote="\"", dec=",") > dataset <- data.frame(x) > library(mice) > md.pattern(x) > md.pairs(x) > imp <- mice(dataset,method="polyreg",maxit=5) > mice.impute.polyreg(dataset, nnet.maxit = 100,nnet.trace = FALSE, > nnet.maxNWts = 1500) > traceback() > > MI TABLA > structure(list(ï..psraid = c(202517L, 202518L, 202520L, 202523L, > 202527L, 202537L, 202543L, 202544L, 202551L, 202566L, 202570L, > 202571L, 202606L, 202619L, 202624L, 202629L, 202631L, 202632L, > 202633L, 202648L, 202657L, 202663L, 202676L, 202683L, 202685L, > 202706L, 202708L, 202709L, 202710L, 202734L, 202735L, 202736L, > 202737L, 202746L, 202753L, 202764L, 202769L, 202772L, 202773L, > 202776L, 202811L, 202816L, 202824L, 202832L, 202842L, 202845L, > 202848L, 202856L, 202858L, 202861L), sample = structure(c(1L, > 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > 1L), .Label = c("Cell", "Landline"), class = "factor"), state > structure(c(31L, > 38L, 24L, 12L, 32L, 9L, 47L, 12L, 9L, 19L, 32L, 39L, 12L, 22L, > 24L, 7L, 14L, 10L, 14L, 26L, 4L, 21L, 24L, 13L, 17L, 16L, 44L, > 8L, 16L, 4L, 9L, 28L, 44L, 10L, 37L, 25L, 26L, 4L, 33L, 4L, 4L, > 12L, 4L, 26L, 36L, 27L, 6L, 45L, 4L, 4L), .Label = c(" 1", " 4", > " 5", " 6", " 8", " 9", "Delaware", "District of Columbia", "Florida", > "Georgia", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", > "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", > "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", > "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", > "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", > "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", > "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", > "Wisconsin"), class = "factor"), cregion = structure(c(2L, 2L, > 1L, 1L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 3L, 1L, 3L, > 1L, 1L, 4L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, > 2L, 4L, 1L, 4L, 1L, 4L, 4L, 1L, 4L, 1L, 4L, 4L, 2L, 4L, 4L, 4L > ), .Label = c("Midwest", "Northeast", "South", "West"), class = "factor"), > usr = structure(c(2L, 2L, 1L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, > 3L, 2L, 1L, 3L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, > 3L, 3L, 3L, 1L, 2L, 2L, 3L, 2L, 1L, 2L, 2L, 2L, 2L, 3L, 2L, > 2L, 1L, 2L, 1L, 3L, 2L, 3L, 2L, 2L, 2L), .Label = c("Rural", > "Suburban", "Urban"), class = "factor"), pial1a > structure(c(NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > NA_integer_, NA_integer_, NA_integer_, NA_integer_), .Label = c("No", > "Yes"), class = "factor"), pial1b = structure(c(2L, 2L, 2L, > 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, > 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, > 3L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, > 3L, 1L), .Label = c("(DO NOT READ) Don't know", "No", "Yes" > ), class = "factor"), pial1c = structure(c(3L, 3L, 3L, 2L, > 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 3L, > 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, > 3L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 4L, 3L, > 3L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", > "No", "Yes"), class = "factor"), pial1d = structure(c(1L, > 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, > 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, > 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, > 2L, 2L, 2L, 1L), .Label = c("No", "Yes"), class = "factor"), > pial1e = structure(c(2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, > 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, > 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, > 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L), .Label = c("No", > "Yes"), class = "factor"), pial2 = structure(c(1L, 1L, 1L, > 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 2L, > 3L, 1L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 1L, 2L, 1L, 1L, 1L, > 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 3L, 3L, 3L, > 1L, 1L), .Label = c("No, not a smartphone", "Not sure/Don't know", > "Yes, smartphone"), class = "factor"), pial3a = structure(c(5L, > 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 5L, > 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, > 4L, 5L, 4L, 4L, 4L, 5L, 4L, 5L, 4L, 1L, 4L, 5L, 5L, 5L, 5L, > 5L, 5L, 5L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) > Refused", > "Have done this but not in last 30 days (VOL.)", "No, have not done > this", > "Yes, have done this"), class = "factor"), pial3b = structure(c(4L, > 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 5L, 4L, 5L, 5L, 5L, 3L, 4L, > 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, > 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, > 5L, 5L, 3L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) > Refused", > "Cell phone is not able to do this (VOL.)", "No, have not done this", > "Yes, have done this"), class = "factor"), pial3c = structure(c(5L, > 5L, 5L, 5L, 5L, 6L, 6L, 3L, 5L, 6L, 5L, 5L, 6L, 5L, 3L, 5L, > 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 3L, > 5L, 5L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, > 6L, 6L, 3L, 5L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) > Refused", > "Cell phone is not able to do this (VOL.)", "Have done this but not in > last 30 days (VOL.)", > "No, have not done this", "Yes, have done this"), class = "factor"), > pial4 = structure(c(NA, NA, NA, NA, NA, 2L, 3L, NA, NA, 5L, > NA, NA, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, NA, NA, 3L, 5L, > NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 5L, 5L, NA, NA, NA, > NA, NA, NA, NA, 3L, 5L, 6L, 2L, NA, NA), .Label = c("(DO NOT READ) > Don't know", > "(DO NOT READ) Refused", "No, did not purchase", "Yes, purchased at > another store", > "Yes, purchased at store", "Yes, purchased online"), class = "factor"), > employ = structure(c(2L, 2L, 4L, 2L, 4L, 2L, 3L, 2L, 2L, > 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 4L, 2L, 4L, 3L, 2L, > 3L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, > 2L, 4L, 2L, 4L, 4L, 2L, 4L, 2L, 2L, 3L, 4L), .Label = c("(DO NOT READ) > Don’t know/Refused", > "Employed full-time", "Employed part-time", "Not employed" > ), class = "factor"), par = structure(c(2L, 2L, 2L, 3L, 1L, > 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, > 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L > ), .Label = c("(DO NOT READ) Don’t know/Refused", > "No", "Yes"), class = "factor"), sex = structure(c(1L, 1L, > 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, > 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, > 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, > 1L, 1L, 2L), .Label = c("Female", "Male"), class = "factor"), > age = structure(c(42L, 46L, 49L, 16L, 37L, 12L, 22L, 40L, > 6L, 17L, 36L, 8L, 10L, 4L, 31L, 12L, 16L, 41L, 8L, 11L, 9L, > 8L, 61L, 21L, 45L, 12L, 32L, 18L, 25L, 48L, 34L, 38L, 46L, > 26L, 51L, 50L, 11L, 1L, 5L, 1L, 46L, 44L, 46L, 2L, 8L, 9L, > 12L, 17L, 31L, 44L), .Label = c("(DO NOT READ) Refused", > "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", "55", "56", "57", > "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", > "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", > "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", > "88", "89", "90", "92"), class = "factor"), educ2 = structure(c(3L, > 3L, 9L, 7L, 7L, 2L, 3L, 2L, 6L, 6L, 1L, 3L, 2L, 9L, 4L, 7L, > 2L, 3L, 9L, 3L, 9L, 3L, 7L, 8L, 3L, 3L, 3L, 7L, 3L, 4L, 4L, > 7L, 9L, 3L, 3L, 7L, 3L, 2L, 9L, 2L, 6L, 3L, 2L, 3L, 7L, 3L, > 2L, 2L, 2L, 7L), .Label = c("Don't know/Refused (VOL.)", > "Four year college or university degree/Bachelor’s degree (e.g., > BS, BA, AB)", > "High school graduate (Grade 12 with diploma or GED certificate)", > "High school incomplete (Grades 9-11 or Grade 12 with NO diploma)", > "Less than high school (Grades 1-8 or no formal schooling)", > "Postgraduate or professional degree, including master’s, > doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)", > "Some college, no degree (includes some community college)", > "Some postgraduate or professional schooling, no postgraduate degree", > "Two year associate degree from a college or university"), class > "factor"), > hisp = structure(c(2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, > 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, > 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("(DO NOT READ) > Don’t know/Refused", > "No", "Yes"), class = "factor"), race = structure(c(7L, 7L, > 7L, 7L, 5L, 7L, 7L, 7L, 3L, 2L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > 7L, 7L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 3L, 4L, 7L, 3L, 7L, 6L, > 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 5L, 3L, 7L, > 7L, 7L, 7L), .Label = c("(DO NOT READ) Don’t know/Refused", > "Asian or Pacific Islander", "Black or African-American", > "Mixed race", "Native American/American Indian", "Other (SPECIFY)", > "White"), class = "factor"), inc = structure(c(8L, 6L, 10L, > 7L, 1L, 10L, 6L, 8L, 9L, 7L, 10L, 2L, 7L, 4L, 2L, 6L, 9L, > 3L, 4L, 1L, 3L, 10L, 5L, 8L, 5L, 5L, 3L, 4L, 3L, 1L, 4L, > 3L, 6L, 1L, 10L, 4L, 7L, 1L, 2L, 6L, 9L, 5L, 4L, 5L, 1L, > 5L, 5L, 7L, 8L, 2L), .Label = c(" 1", " 2", " 3", " 4", " 5", > " 6", " 7", " 8", " 9", "(DO NOT READ) Don’t know/Refused" > ), class = "factor"), weight = c(2.9024390244, 2.3414634146, > 1, 3.6097560976, 3.0243902439, 4.3170731707, 6.6585365854, > 3.6341463415, 1.3170731707, 2.8292682927, 2.4390243902, 2.4146341463, > 2.9268292683, 4.8292682927, 7.1463414634, 7.1463414634, 2.3658536585, > 4.487804878, 1.756097561, 2.756097561, 5.1707317073, 1.9268292683, > 2.8780487805, 2.2195121951, 2.3414634146, 7.1463414634, 7.1463414634, > 7.1463414634, 2.6097560976, 2.4634146341, 5.6097560976, 4.5365853659, > 2.487804878, 5.8780487805, 4.0243902439, 2.0731707317, 6.512195122, > 3.7804878049, 1.756097561, 1.1951219512, 1.2682926829, 1.9024390244, > 1.5365853659, 1.6097560976, 1.1463414634, 3.6829268293, 7.1463414634, > 4.7317073171, 2.2195121951, 1.5609756098), standwt = c(0.9676919303, > 0.7806590362, 0.3334064634, 1.2035160141, 1.0083512551, 1.4393400979, > 2.2199991341, 1.2116478791, 0.4391207078, 0.9432963354, 0.813186496, > 0.8050546311, 0.9758237952, 1.6101092621, 2.3826364333, 2.3826364333, > 0.7887909011, 1.4962631527, 0.5854942771, 0.9189007405, 1.7239553715, > 0.6424173318, 0.9595600653, 0.7399997114, 0.7806590362, 2.3826364333, > 2.3826364333, 2.3826364333, 0.8701095507, 0.821318361, 1.8703289408, > 1.5125268826, 0.8294502259, 1.9597794554, 1.3417577184, 0.6912085216, > 2.1712079444, 1.2604390688, 0.5854942771, 0.398461383, 0.4228569779, > 0.6342854669, 0.5123074925, 0.5367030874, 0.3821976531, 1.227911609, > 2.3826364333, 1.5775818023, 0.7399997114, 0.5204393574)), .Names > c("ï..psraid", > "sample", "state", "cregion", "usr", "pial1a", "pial1b", "pial1c", > "pial1d", "pial1e", "pial2", "pial3a", "pial3b", "pial3c", "pial4", > "employ", "par", "sex", "age", "educ2", "hisp", "race", "inc", > "weight", "standwt"), row.names = 954:1003, class = "data.frame") > > dput(tail(dataset, 50)) > > -- > > *************** * :) *sonrei que te queda lindo :):):):): **amy **cgc > ************************** > * > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > >-- Daniel [[alternative HTML version deleted]]
Amalia Carolina Guaymas Canavire
2013-Oct-30 22:55 UTC
[R-es] disculpe las molestias ...ayuda con MICE
Muchas gracias, pero claro en una muestra de 50 datos se ejecuta, en la muestra original de 1000 registros me tira error :( 2013/10/30 daniel <daniel319@gmail.com>> Amalia, > > No obtengo tus resultados. Corrí tus formulas y datos y el resultado es > x <- structure(list(ï..psraid = c(202517L, 202518L, 202520L, 202523L, > + 202527L, 202537L, 202543L, 202544L, 202551L, 202566L, 202570L, > + 202571L, 202606L, 202619L, 202624L, 202629L, 202631L, 202632L, > + 202633L, 202648L, 202657L, 202663L, 202676L, 202683L, 202685L, > + 202706L, 202708L, 202709L, 202710L, 202734L, 202735L, 202736L, > + 202737L, 202746L, 202753L, 202764L, 202769L, 202772L, 202773L, > + 202776L, 202811L, 202816L, 202824L, 202832L, 202842L, 202845L, > + 202848L, 202856L, 202858L, 202861L), sample = structure(c(1L, > + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > + 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > + 1L), .Label = c("Cell", "Landline"), class = "factor"), state > + structure(c(31L, > + 38L, 24L, 12L, 32L, 9L, 47L, 12L, 9L, 19L, 32L, 39L, 12L, 22L, > + 24L, 7L, 14L, 10L, 14L, 26L, 4L, 21L, 24L, 13L, 17L, 16L, 44L, > + 8L, 16L, 4L, 9L, 28L, 44L, 10L, 37L, 25L, 26L, 4L, 33L, 4L, 4L, > + 12L, 4L, 26L, 36L, 27L, 6L, 45L, 4L, 4L), .Label = c(" 1", " 4", > + " 5", " 6", " 8", " 9", "Delaware", "District of Columbia", "Florida", > + "Georgia", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", > + "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", > + "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", > + "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", > + "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", > + "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", > + "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", > + "Wisconsin"), class = "factor"), cregion = structure(c(2L, 2L, > + 1L, 1L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 3L, 1L, 3L, > + 1L, 1L, 4L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, > + 2L, 4L, 1L, 4L, 1L, 4L, 4L, 1L, 4L, 1L, 4L, 4L, 2L, 4L, 4L, 4L > + ), .Label = c("Midwest", "Northeast", "South", "West"), class > "factor"), > + usr = structure(c(2L, 2L, 1L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, > + 3L, 2L, 1L, 3L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, > + 3L, 3L, 3L, 1L, 2L, 2L, 3L, 2L, 1L, 2L, 2L, 2L, 2L, 3L, 2L, > + 2L, 1L, 2L, 1L, 3L, 2L, 3L, 2L, 2L, 2L), .Label = c("Rural", > + "Suburban", "Urban"), class = "factor"), pial1a > + structure(c(NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > + NA_integer_, NA_integer_, NA_integer_, NA_integer_), .Label = c("No", > + "Yes"), class = "factor"), pial1b = structure(c(2L, 2L, 2L, > + 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, > + 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, > + 3L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, > + 3L, 1L), .Label = c("(DO NOT READ) Don't know", "No", "Yes" > + ), class = "factor"), pial1c = structure(c(3L, 3L, 3L, 2L, > + 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 3L, > + 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, > + 3L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 4L, 3L, > + 3L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", > + "No", "Yes"), class = "factor"), pial1d = structure(c(1L, > + 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, > + 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, > + 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, > + 2L, 2L, 2L, 1L), .Label = c("No", "Yes"), class = "factor"), > + pial1e = structure(c(2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, > + 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, > + 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, > + 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L), .Label = c("No", > + "Yes"), class = "factor"), pial2 = structure(c(1L, 1L, 1L, > + 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 2L, > + 3L, 1L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 1L, 2L, 1L, 1L, 1L, > + 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 3L, 3L, 3L, > + 1L, 1L), .Label = c("No, not a smartphone", "Not sure/Don't know", > + "Yes, smartphone"), class = "factor"), pial3a = structure(c(5L, > + 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 5L, > + 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, > + 4L, 5L, 4L, 4L, 4L, 5L, 4L, 5L, 4L, 1L, 4L, 5L, 5L, 5L, 5L, > + 5L, 5L, 5L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT > READ) > + Refused", > + "Have done this but not in last 30 days (VOL.)", "No, have not done > + this", > + "Yes, have done this"), class = "factor"), pial3b = structure(c(4L, > + 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 5L, 4L, 5L, 5L, 5L, 3L, 4L, > + 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, > + 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, > + 5L, 5L, 3L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT > READ) > + Refused", > + "Cell phone is not able to do this (VOL.)", "No, have not done this", > + "Yes, have done this"), class = "factor"), pial3c = structure(c(5L, > + 5L, 5L, 5L, 5L, 6L, 6L, 3L, 5L, 6L, 5L, 5L, 6L, 5L, 3L, 5L, > + 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 3L, > + 5L, 5L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, > + 6L, 6L, 3L, 5L), .Label = c("(DO NOT READ) Don't know", "(DO NOT > READ) > + Refused", > + "Cell phone is not able to do this (VOL.)", "Have done this but not > in > + last 30 days (VOL.)", > + "No, have not done this", "Yes, have done this"), class = "factor"), > + pial4 = structure(c(NA, NA, NA, NA, NA, 2L, 3L, NA, NA, 5L, > + NA, NA, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, NA, NA, 3L, 5L, > + NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 5L, 5L, NA, NA, NA, > + NA, NA, NA, NA, 3L, 5L, 6L, 2L, NA, NA), .Label = c("(DO NOT READ) > + Don't know", > + "(DO NOT READ) Refused", "No, did not purchase", "Yes, purchased at > + another store", > + "Yes, purchased at store", "Yes, purchased online"), class > "factor"), > + employ = structure(c(2L, 2L, 4L, 2L, 4L, 2L, 3L, 2L, 2L, > + 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 4L, 2L, 4L, 3L, 2L, > + 3L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, > + 2L, 4L, 2L, 4L, 4L, 2L, 4L, 2L, 2L, 3L, 4L), .Label = c("(DO NOT > READ) > + Don’t know/Refused", > + "Employed full-time", "Employed part-time", "Not employed" > + ), class = "factor"), par = structure(c(2L, 2L, 2L, 3L, 1L, > + 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, > + 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > + 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L > + ), .Label = c("(DO NOT READ) Don’t know/Refused", > + "No", "Yes"), class = "factor"), sex = structure(c(1L, 1L, > + 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, > + 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, > + 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, > + 1L, 1L, 2L), .Label = c("Female", "Male"), class = "factor"), > + age = structure(c(42L, 46L, 49L, 16L, 37L, 12L, 22L, 40L, > + 6L, 17L, 36L, 8L, 10L, 4L, 31L, 12L, 16L, 41L, 8L, 11L, 9L, > + 8L, 61L, 21L, 45L, 12L, 32L, 18L, 25L, 48L, 34L, 38L, 46L, > + 26L, 51L, 50L, 11L, 1L, 5L, 1L, 46L, 44L, 46L, 2L, 8L, 9L, > + 12L, 17L, 31L, 44L), .Label = c("(DO NOT READ) Refused", > + "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", "55", "56", "57", > + "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", > + "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", > + "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", > + "88", "89", "90", "92"), class = "factor"), educ2 = structure(c(3L, > + 3L, 9L, 7L, 7L, 2L, 3L, 2L, 6L, 6L, 1L, 3L, 2L, 9L, 4L, 7L, > + 2L, 3L, 9L, 3L, 9L, 3L, 7L, 8L, 3L, 3L, 3L, 7L, 3L, 4L, 4L, > + 7L, 9L, 3L, 3L, 7L, 3L, 2L, 9L, 2L, 6L, 3L, 2L, 3L, 7L, 3L, > + 2L, 2L, 2L, 7L), .Label = c("Don't know/Refused (VOL.)", > + "Four year college or university degree/Bachelor’s degree > (e.g., > + BS, BA, AB)", > + "High school graduate (Grade 12 with diploma or GED certificate)", > + "High school incomplete (Grades 9-11 or Grade 12 with NO diploma)", > + "Less than high school (Grades 1-8 or no formal schooling)", > + "Postgraduate or professional degree, including master’s, > + doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)", > + "Some college, no degree (includes some community college)", > + "Some postgraduate or professional schooling, no postgraduate > degree", > + "Two year associate degree from a college or university"), class > + "factor"), > + hisp = structure(c(2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, > + 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, > + 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > + 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("(DO NOT READ) > + Don’t know/Refused", > + "No", "Yes"), class = "factor"), race = structure(c(7L, 7L, > + 7L, 7L, 5L, 7L, 7L, 7L, 3L, 2L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > + 7L, 7L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 3L, 4L, 7L, 3L, 7L, 6L, > + 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 5L, 3L, 7L, > + 7L, 7L, 7L), .Label = c("(DO NOT READ) Don’t know/Refused", > + "Asian or Pacific Islander", "Black or African-American", > + "Mixed race", "Native American/American Indian", "Other (SPECIFY)", > + "White"), class = "factor"), inc = structure(c(8L, 6L, 10L, > + 7L, 1L, 10L, 6L, 8L, 9L, 7L, 10L, 2L, 7L, 4L, 2L, 6L, 9L, > + 3L, 4L, 1L, 3L, 10L, 5L, 8L, 5L, 5L, 3L, 4L, 3L, 1L, 4L, > + 3L, 6L, 1L, 10L, 4L, 7L, 1L, 2L, 6L, 9L, 5L, 4L, 5L, 1L, > + 5L, 5L, 7L, 8L, 2L), .Label = c(" 1", " 2", " 3", " 4", " 5", > + " 6", " 7", " 8", " 9", "(DO NOT READ) Don’t know/Refused" > + ), class = "factor"), weight = c(2.9024390244, 2.3414634146, > + 1, 3.6097560976, 3.0243902439, 4.3170731707, 6.6585365854, > + 3.6341463415, 1.3170731707, 2.8292682927, 2.4390243902, 2.4146341463, > + 2.9268292683, 4.8292682927, 7.1463414634, 7.1463414634, 2.3658536585, > + 4.487804878, 1.756097561, 2.756097561, 5.1707317073, 1.9268292683, > + 2.8780487805, 2.2195121951, 2.3414634146, 7.1463414634, 7.1463414634, > + 7.1463414634, 2.6097560976, 2.4634146341, 5.6097560976, 4.5365853659, > + 2.487804878, 5.8780487805, 4.0243902439, 2.0731707317, 6.512195122, > + 3.7804878049, 1.756097561, 1.1951219512, 1.2682926829, 1.9024390244, > + 1.5365853659, 1.6097560976, 1.1463414634, 3.6829268293, 7.1463414634, > + 4.7317073171, 2.2195121951, 1.5609756098), standwt = c(0.9676919303, > + 0.7806590362, 0.3334064634, 1.2035160141, 1.0083512551, 1.4393400979, > + 2.2199991341, 1.2116478791, 0.4391207078, 0.9432963354, 0.813186496, > + 0.8050546311, 0.9758237952, 1.6101092621, 2.3826364333, 2.3826364333, > + 0.7887909011, 1.4962631527, 0.5854942771, 0.9189007405, 1.7239553715, > + 0.6424173318, 0.9595600653, 0.7399997114, 0.7806590362, 2.3826364333, > + 2.3826364333, 2.3826364333, 0.8701095507, 0.821318361, 1.8703289408, > + 1.5125268826, 0.8294502259, 1.9597794554, 1.3417577184, 0.6912085216, > + 2.1712079444, 1.2604390688, 0.5854942771, 0.398461383, 0.4228569779, > + 0.6342854669, 0.5123074925, 0.5367030874, 0.3821976531, 1.227911609, > + 2.3826364333, 1.5775818023, 0.7399997114, 0.5204393574)), .Names > + c("ï..psraid", > + "sample", "state", "cregion", "usr", "pial1a", "pial1b", "pial1c", > + "pial1d", "pial1e", "pial2", "pial3a", "pial3b", "pial3c", "pial4", > + "employ", "par", "sex", "age", "educ2", "hisp", "race", "inc", > + "weight", "standwt"), row.names = 954:1003, class = "data.frame") > > > > dataset <- data.frame(x) > > library(mice) > Loading required package: lattice > Loading required package: MASS > Loading required package: nnet > mice 2.18 2013-07-31 > Warning messages: > 1: package ‘mice’ was built under R version 3.0.2 > 2: package ‘lattice’ was built under R version 3.0.2 > > md.pattern(x) > ï..psraid sample state cregion usr pial1b pial1c pial1d pial1e pial2 > pial3a pial3b pial3c employ par sex age educ2 hisp race inc weight standwt > pial4 pial1a > 13 1 1 1 1 1 1 1 1 1 1 > 1 1 1 1 1 1 1 1 1 1 1 1 1 > 1 0 1 > 37 1 1 1 1 1 1 1 1 1 1 > 1 1 1 1 1 1 1 1 1 1 1 1 1 > 0 0 2 > 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 37 50 87 > > md.pairs(x) > $rr > ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d > pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race > inc weight standwt > ï..psraid 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > sample 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > state 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > cregion 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > usr 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial1a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1b 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial1c 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial1d 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial1e 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial2 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial3a 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial3b 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial3c 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial4 13 13 13 13 13 0 13 13 13 > 13 13 13 13 13 13 13 13 13 13 13 13 13 > 13 13 13 > employ 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > par 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > sex 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > age 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > educ2 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > hisp 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > race 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > inc 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > weight 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > standwt 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > > $rm > ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d > pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race > inc weight standwt > ï..psraid 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > sample 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > state 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > cregion 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > usr 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial1a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1b 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial1c 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial1d 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial1e 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial2 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial3a 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial3b 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial3c 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial4 0 0 0 0 0 13 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > employ 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > par 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > sex 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > age 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > educ2 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > hisp 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > race 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > inc 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > weight 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > standwt 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > > $mr > ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d > pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race > inc weight standwt > ï..psraid 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sample 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > state 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > cregion 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > usr 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1a 50 50 50 50 50 0 50 50 50 > 50 50 50 50 50 13 50 50 50 50 50 50 50 > 50 50 50 > pial1b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1d 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1e 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial4 37 37 37 37 37 0 37 37 37 > 37 37 37 37 37 0 37 37 37 37 37 37 37 > 37 37 37 > employ 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > par 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sex 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > age 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > educ2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > hisp 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > race 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > inc 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > weight 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > standwt 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > > $mm > ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d > pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race > inc weight standwt > ï..psraid 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sample 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > state 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > cregion 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > usr 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1a 0 0 0 0 0 50 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > pial1b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1d 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1e 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial4 0 0 0 0 0 37 0 0 0 > 0 0 0 0 0 37 0 0 0 0 0 0 0 > 0 0 0 > employ 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > par 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sex 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > age 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > educ2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > hisp 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > race 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > inc 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > weight 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > standwt 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > > > # en caso de que mice haga uso de números aleatorios fijo el seed para > que sea reproducible > > set.seed(123) > > imp <- mice(dataset,method="polyreg",maxit=5) > > iter imp variable > 1 1 pial4 > 1 2 pial4 > 1 3 pial4 > 1 4 pial4 > 1 5 pial4 > 2 1 pial4 > 2 2 pial4 > 2 3 pial4 > 2 4 pial4 > 2 5 pial4 > 3 1 pial4 > 3 2 pial4 > 3 3 pial4 > 3 4 pial4 > 3 5 pial4 > 4 1 pial4 > 4 2 pial4 > 4 3 pial4 > 4 4 pial4 > 4 5 pial4 > 5 1 pial4 > 5 2 pial4 > 5 3 pial4 > 5 4 pial4 > 5 5 pial4 > > imp > Multiply imputed data set > Call: > mice(data = dataset, method = "polyreg", maxit = 5) > Number of multiple imputations: 5 > Missing cells per column: > ï..psraid sample state cregion usr pial1a pial1b > pial1c pial1d pial1e pial2 pial3a pial3b pial3c > pial4 employ par > 0 0 0 0 0 50 0 > 0 0 0 0 0 0 0 37 > 0 0 > sex age educ2 hisp race inc weight > standwt > 0 0 0 0 0 0 0 > 0 > Imputation methods: > ï..psraid sample state cregion usr pial1a pial1b > pial1c pial1d pial1e pial2 pial3a pial3b pial3c > pial4 employ par > "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" > "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" > "polyreg" "polyreg" "polyreg" > sex age educ2 hisp race inc weight > standwt > "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" "polyreg" > "polyreg" > VisitSequence: > pial4 > 15 > PredictorMatrix: > ï..psraid sample state cregion usr pial1a pial1b pial1c pial1d > pial1e pial2 pial3a pial3b pial3c pial4 employ par sex age educ2 hisp race > inc weight standwt > ï..psraid 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sample 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > state 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > cregion 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > usr 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1d 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial1e 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3a 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3b 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial3c 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > pial4 1 0 1 1 1 0 1 1 1 > 1 1 1 1 1 0 1 1 1 1 1 1 1 > 1 1 0 > employ 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > par 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > sex 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > age 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > educ2 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > hisp 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > race 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > inc 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > weight 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > standwt 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 > Random generator seed value: NA > > sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: i386-w64-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=Spanish_Argentina.1252 LC_CTYPE=Spanish_Argentina.1252 > LC_MONETARY=Spanish_Argentina.1252 LC_NUMERIC=C > [5] LC_TIME=Spanish_Argentina.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] mice_2.18 nnet_7.3-7 MASS_7.3-29 lattice_0.20-24 > devtools_1.3 > > loaded via a namespace (and not attached): > [1] digest_0.6.3 evaluate_0.5.1 grid_3.0.1 httr_0.2 > memoise_0.1 parallel_3.0.1 RCurl_1.95-4.1 rpart_4.1-3 stringr_0.6.2 > tools_3.0.1 whisker_0.3-2 > > Espero te sea de utilidad, > > Daniel Merino > > > > El 30 de octubre de 2013 11:44, Amalia Carolina Guaymas Canavire < > acarolinagc@gmail.com> escribió: > >> Saludo gente, antes que nada gracias por la ayuda que puedan aportarme, >> soy >> iniciante en R, estoy usando el paquete Mice para realizar imputaciones >> múltiples sobre variables en su mayoría categóricas. El problema está que >> cuando expresó este comando imp <- mice(dataset,method="polr",maxit=1) >> donde el dataset es un data.frame me tirá este error : >> >> iter imp variable >> 1 1 pial1a pial2 pial3a pial3b pial3cError en nnet.default(X, Y, >> w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : >> too many (1068) weights >> >> buscando en foros encontre que debo modificar el nnet, concretamente >> maxNWts indicando un valor mayor al valor con problema, para modificar eso >> se me ocurre usar mice.impute.polyreg(dataset x=NULL, nnet.maxit >> 100,nnet.trace = FALSE, nnet.maxNWts = 1500) pero el problema que me piden >> X que representa Matrix (n x p) of complete covariates, pero al ser las >> vbles categóricas, no me queda claro como estimarla. En si alguna ayuda >> para poder solucionar este problema en donde lo que se busca en poder >> aplicar regresión logística y por ello me veo con el problema del nnet. >> GRACIAS: >> >> codigo que uso >> x <- read.table("C:/Omnibus_Jan_2013nom.txt", header=TRUE, sep=",", >> na.strings = c ("NA", ""),quote="\"", dec=",") >> dataset <- data.frame(x) >> library(mice) >> md.pattern(x) >> md.pairs(x) >> imp <- mice(dataset,method="polyreg",maxit=5) >> mice.impute.polyreg(dataset, nnet.maxit = 100,nnet.trace = FALSE, >> nnet.maxNWts = 1500) >> traceback() >> >> MI TABLA >> structure(list(ï..psraid = c(202517L, 202518L, 202520L, 202523L, >> 202527L, 202537L, 202543L, 202544L, 202551L, 202566L, 202570L, >> 202571L, 202606L, 202619L, 202624L, 202629L, 202631L, 202632L, >> 202633L, 202648L, 202657L, 202663L, 202676L, 202683L, 202685L, >> 202706L, 202708L, 202709L, 202710L, 202734L, 202735L, 202736L, >> 202737L, 202746L, 202753L, 202764L, 202769L, 202772L, 202773L, >> 202776L, 202811L, 202816L, 202824L, 202832L, 202842L, 202845L, >> 202848L, 202856L, 202858L, 202861L), sample = structure(c(1L, >> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, >> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, >> 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, >> 1L), .Label = c("Cell", "Landline"), class = "factor"), state >> structure(c(31L, >> 38L, 24L, 12L, 32L, 9L, 47L, 12L, 9L, 19L, 32L, 39L, 12L, 22L, >> 24L, 7L, 14L, 10L, 14L, 26L, 4L, 21L, 24L, 13L, 17L, 16L, 44L, >> 8L, 16L, 4L, 9L, 28L, 44L, 10L, 37L, 25L, 26L, 4L, 33L, 4L, 4L, >> 12L, 4L, 26L, 36L, 27L, 6L, 45L, 4L, 4L), .Label = c(" 1", " 4", >> " 5", " 6", " 8", " 9", "Delaware", "District of Columbia", "Florida", >> "Georgia", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", >> "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", >> "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", >> "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", >> "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", >> "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", >> "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", >> "Wisconsin"), class = "factor"), cregion = structure(c(2L, 2L, >> 1L, 1L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 3L, 1L, 3L, >> 1L, 1L, 4L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, >> 2L, 4L, 1L, 4L, 1L, 4L, 4L, 1L, 4L, 1L, 4L, 4L, 2L, 4L, 4L, 4L >> ), .Label = c("Midwest", "Northeast", "South", "West"), class = "factor"), >> usr = structure(c(2L, 2L, 1L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, >> 3L, 2L, 1L, 3L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, >> 3L, 3L, 3L, 1L, 2L, 2L, 3L, 2L, 1L, 2L, 2L, 2L, 2L, 3L, 2L, >> 2L, 1L, 2L, 1L, 3L, 2L, 3L, 2L, 2L, 2L), .Label = c("Rural", >> "Suburban", "Urban"), class = "factor"), pial1a >> structure(c(NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> NA_integer_, NA_integer_, NA_integer_, NA_integer_), .Label = c("No", >> "Yes"), class = "factor"), pial1b = structure(c(2L, 2L, 2L, >> 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, >> 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, >> 3L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, >> 3L, 1L), .Label = c("(DO NOT READ) Don't know", "No", "Yes" >> ), class = "factor"), pial1c = structure(c(3L, 3L, 3L, 2L, >> 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 3L, >> 3L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, >> 3L, 4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 4L, 3L, >> 3L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) Refused", >> "No", "Yes"), class = "factor"), pial1d = structure(c(1L, >> 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, >> 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, >> 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, >> 2L, 2L, 2L, 1L), .Label = c("No", "Yes"), class = "factor"), >> pial1e = structure(c(2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, >> 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, >> 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, >> 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L), .Label = c("No", >> "Yes"), class = "factor"), pial2 = structure(c(1L, 1L, 1L, >> 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 3L, 3L, 2L, >> 3L, 1L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 1L, 2L, 1L, 1L, 1L, >> 3L, 1L, 3L, 3L, 1L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 3L, 3L, 3L, >> 1L, 1L), .Label = c("No, not a smartphone", "Not sure/Don't know", >> "Yes, smartphone"), class = "factor"), pial3a = structure(c(5L, >> 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 5L, >> 4L, 5L, 4L, 5L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, >> 4L, 5L, 4L, 4L, 4L, 5L, 4L, 5L, 4L, 1L, 4L, 5L, 5L, 5L, 5L, >> 5L, 5L, 5L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) >> Refused", >> "Have done this but not in last 30 days (VOL.)", "No, have not done >> this", >> "Yes, have done this"), class = "factor"), pial3b = structure(c(4L, >> 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 5L, 4L, 5L, 5L, 5L, 3L, 4L, >> 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 5L, 4L, 4L, 4L, 4L, 4L, >> 4L, 4L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, >> 5L, 5L, 3L, 4L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) >> Refused", >> "Cell phone is not able to do this (VOL.)", "No, have not done this", >> "Yes, have done this"), class = "factor"), pial3c = structure(c(5L, >> 5L, 5L, 5L, 5L, 6L, 6L, 3L, 5L, 6L, 5L, 5L, 6L, 5L, 3L, 5L, >> 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 3L, >> 5L, 5L, 5L, 5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, >> 6L, 6L, 3L, 5L), .Label = c("(DO NOT READ) Don't know", "(DO NOT READ) >> Refused", >> "Cell phone is not able to do this (VOL.)", "Have done this but not in >> last 30 days (VOL.)", >> "No, have not done this", "Yes, have done this"), class = "factor"), >> pial4 = structure(c(NA, NA, NA, NA, NA, 2L, 3L, NA, NA, 5L, >> NA, NA, 5L, NA, NA, NA, NA, NA, NA, NA, 3L, NA, NA, 3L, 5L, >> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 5L, 5L, NA, NA, NA, >> NA, NA, NA, NA, 3L, 5L, 6L, 2L, NA, NA), .Label = c("(DO NOT READ) >> Don't know", >> "(DO NOT READ) Refused", "No, did not purchase", "Yes, purchased at >> another store", >> "Yes, purchased at store", "Yes, purchased online"), class >> "factor"), >> employ = structure(c(2L, 2L, 4L, 2L, 4L, 2L, 3L, 2L, 2L, >> 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 4L, 2L, 4L, 3L, 2L, >> 3L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, >> 2L, 4L, 2L, 4L, 4L, 2L, 4L, 2L, 2L, 3L, 4L), .Label = c("(DO NOT READ) >> Don’t know/Refused", >> "Employed full-time", "Employed part-time", "Not employed" >> ), class = "factor"), par = structure(c(2L, 2L, 2L, 3L, 1L, >> 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, >> 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, >> 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 2L >> ), .Label = c("(DO NOT READ) Don’t know/Refused", >> "No", "Yes"), class = "factor"), sex = structure(c(1L, 1L, >> 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, >> 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, >> 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, >> 1L, 1L, 2L), .Label = c("Female", "Male"), class = "factor"), >> age = structure(c(42L, 46L, 49L, 16L, 37L, 12L, 22L, 40L, >> 6L, 17L, 36L, 8L, 10L, 4L, 31L, 12L, 16L, 41L, 8L, 11L, 9L, >> 8L, 61L, 21L, 45L, 12L, 32L, 18L, 25L, 48L, 34L, 38L, 46L, >> 26L, 51L, 50L, 11L, 1L, 5L, 1L, 46L, 44L, 46L, 2L, 8L, 9L, >> 12L, 17L, 31L, 44L), .Label = c("(DO NOT READ) Refused", >> "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", "55", "56", "57", >> "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", >> "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", >> "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", >> "88", "89", "90", "92"), class = "factor"), educ2 = structure(c(3L, >> 3L, 9L, 7L, 7L, 2L, 3L, 2L, 6L, 6L, 1L, 3L, 2L, 9L, 4L, 7L, >> 2L, 3L, 9L, 3L, 9L, 3L, 7L, 8L, 3L, 3L, 3L, 7L, 3L, 4L, 4L, >> 7L, 9L, 3L, 3L, 7L, 3L, 2L, 9L, 2L, 6L, 3L, 2L, 3L, 7L, 3L, >> 2L, 2L, 2L, 7L), .Label = c("Don't know/Refused (VOL.)", >> "Four year college or university degree/Bachelor’s degree >> (e.g., >> BS, BA, AB)", >> "High school graduate (Grade 12 with diploma or GED certificate)", >> "High school incomplete (Grades 9-11 or Grade 12 with NO diploma)", >> "Less than high school (Grades 1-8 or no formal schooling)", >> "Postgraduate or professional degree, including master’s, >> doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)", >> "Some college, no degree (includes some community college)", >> "Some postgraduate or professional schooling, no postgraduate degree", >> "Two year associate degree from a college or university"), class >> "factor"), >> hisp = structure(c(2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, >> 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, >> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, >> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("(DO NOT READ) >> Don’t know/Refused", >> "No", "Yes"), class = "factor"), race = structure(c(7L, 7L, >> 7L, 7L, 5L, 7L, 7L, 7L, 3L, 2L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, >> 7L, 7L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 3L, 4L, 7L, 3L, 7L, 6L, >> 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 5L, 3L, 7L, >> 7L, 7L, 7L), .Label = c("(DO NOT READ) Don’t know/Refused", >> "Asian or Pacific Islander", "Black or African-American", >> "Mixed race", "Native American/American Indian", "Other (SPECIFY)", >> "White"), class = "factor"), inc = structure(c(8L, 6L, 10L, >> 7L, 1L, 10L, 6L, 8L, 9L, 7L, 10L, 2L, 7L, 4L, 2L, 6L, 9L, >> 3L, 4L, 1L, 3L, 10L, 5L, 8L, 5L, 5L, 3L, 4L, 3L, 1L, 4L, >> 3L, 6L, 1L, 10L, 4L, 7L, 1L, 2L, 6L, 9L, 5L, 4L, 5L, 1L, >> 5L, 5L, 7L, 8L, 2L), .Label = c(" 1", " 2", " 3", " 4", " 5", >> " 6", " 7", " 8", " 9", "(DO NOT READ) Don’t know/Refused" >> ), class = "factor"), weight = c(2.9024390244, 2.3414634146, >> 1, 3.6097560976, 3.0243902439, 4.3170731707, 6.6585365854, >> 3.6341463415, 1.3170731707, 2.8292682927, 2.4390243902, 2.4146341463, >> 2.9268292683, 4.8292682927, 7.1463414634, 7.1463414634, 2.3658536585, >> 4.487804878, 1.756097561, 2.756097561, 5.1707317073, 1.9268292683, >> 2.8780487805, 2.2195121951, 2.3414634146, 7.1463414634, 7.1463414634, >> 7.1463414634, 2.6097560976, 2.4634146341, 5.6097560976, 4.5365853659, >> 2.487804878, 5.8780487805, 4.0243902439, 2.0731707317, 6.512195122, >> 3.7804878049, 1.756097561, 1.1951219512, 1.2682926829, 1.9024390244, >> 1.5365853659, 1.6097560976, 1.1463414634, 3.6829268293, 7.1463414634, >> 4.7317073171, 2.2195121951, 1.5609756098), standwt = c(0.9676919303, >> 0.7806590362, 0.3334064634, 1.2035160141, 1.0083512551, 1.4393400979, >> 2.2199991341, 1.2116478791, 0.4391207078, 0.9432963354, 0.813186496, >> 0.8050546311, 0.9758237952, 1.6101092621, 2.3826364333, 2.3826364333, >> 0.7887909011, 1.4962631527, 0.5854942771, 0.9189007405, 1.7239553715, >> 0.6424173318, 0.9595600653, 0.7399997114, 0.7806590362, 2.3826364333, >> 2.3826364333, 2.3826364333, 0.8701095507, 0.821318361, 1.8703289408, >> 1.5125268826, 0.8294502259, 1.9597794554, 1.3417577184, 0.6912085216, >> 2.1712079444, 1.2604390688, 0.5854942771, 0.398461383, 0.4228569779, >> 0.6342854669, 0.5123074925, 0.5367030874, 0.3821976531, 1.227911609, >> 2.3826364333, 1.5775818023, 0.7399997114, 0.5204393574)), .Names >> c("ï..psraid", >> "sample", "state", "cregion", "usr", "pial1a", "pial1b", "pial1c", >> "pial1d", "pial1e", "pial2", "pial3a", "pial3b", "pial3c", "pial4", >> "employ", "par", "sex", "age", "educ2", "hisp", "race", "inc", >> "weight", "standwt"), row.names = 954:1003, class = "data.frame") >> > dput(tail(dataset, 50)) >> >> -- >> >> *************** * :) *sonrei que te queda lindo :):):):): **amy **cgc >> ************************** >> * >> >> [[alternative HTML version deleted]] >> >> >> _______________________________________________ >> R-help-es mailing list >> R-help-es@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-help-es >> >> > > > -- > Daniel >-- *************** * :) *sonrei que te queda lindo :):):):): **amy **cgc ************************** * [[alternative HTML version deleted]]