pd <- smcure(Surv(unemployment_time,censor)~Sex+Immigrant+Education_level,
cureform=~Sex+Immigrant+Education_level,
data=dmpold,na.action=na.omit,model="ph",Var=TRUE)
Программа работает ... наберитесь терпения ... Ошибка в [[<-. Data.frame (<em> tmp , i, значение = c (19L, 19L, 19L, 18L, 19L: замена содержит 2250 строк, данные имеют 750
Я получаю эту ошибку
Мои данные выглядят так
> str(dmpold)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 1568 obs. of 12 variables:
$ ...1 : chr "109" "761" "844" "1907" ...
$ person_id : num 89 634 708 1604 1848 ...
$ Region : Factor w/ 13 levels "Aalst-Oudenaarde",..: 11 4 6 7 2 2 13 4 7 12 ...
$ Education_level : Factor w/ 17 levels "1Primary Education/1th Degree Secondary Education",..: 14
17 11 16 17 13 13 11 8 17 ...
$ Age : num 61 62 63 60 60 61 62 60 63 63 ...
$ Driver_License : Factor w/ 12 levels "A","A3","B","BE",..: 3 NA 3 5 3 3 3 3 7 3 ...
$ Transportation : Factor w/ 5 levels "Bicycle","Car",..: 2 NA 2 2 NA 2 2 2 NA 2 ...
$ Knowledge_Dutch : Factor w/ 4 levels "Good Knowledge",..: 2 1 1 4 1 4 4 4 1 2 ...
$ Immigrant : num 0 0 0 0 0 0 0 0 0 0 ...
$ Sex : Factor w/ 2 levels "F","M": 2 1 2 2 2 1 2 2 2 2 ...
$ unemployment_time: num 39 5 2 3 3 2 3 2 9 6 ...
$ censor : num 0 0 0 1 1 0 1 0 0 1 ...
Данные имеет 1568 наблюдений, так что я не понимаю, почему в нем содержится 750 строк? Более того, замена - это всегда умножение количества ковариат, которые я положил в модель (здесь 750x3 = 2250) Заранее спасибо!
structure(list(X = c(28L, 77L, 91L, 109L, 125L, 136L, 140L, 219L,
306L, 372L, 396L, 405L, 439L, 441L, 461L, 504L, 537L, 569L, 585L,
608L, 616L, 617L, 657L, 681L, 698L, 700L, 729L, 761L, 765L, 778L,
786L, 808L, 813L, 818L, 844L, 850L, 989L, 1150L, 1165L, 1194L,
1198L, 1210L, 1314L, 1324L, 1342L, 1442L, 1482L, 1496L, 1621L,
1640L, 1680L, 1691L, 1726L, 1758L, 1772L, 1803L, 1813L, 1821L,
1828L, 1907L, 1958L, 1981L, 1988L, 1998L, 2011L, 2012L, 2019L,
2106L, 2114L, 2120L, 2140L, 2148L, 2167L, 2193L, 2242L, 2274L,
2336L, 2342L, 2393L, 2394L, 2427L, 2442L, 2461L, 2485L, 2489L,
2499L, 2525L, 2530L, 2541L, 2581L, 2589L, 2683L, 2684L, 2733L,
2765L, 2854L, 2860L, 2902L, 2936L, 2940L), person_id = c(24L,
62L, 73L, 89L, 102L, 111L, 115L, 184L, 258L, 311L, 331L, 339L,
371L, 373L, 390L, 428L, 453L, 480L, 494L, 512L, 520L, 521L, 551L,
568L, 583L, 584L, 610L, 634L, 638L, 650L, 657L, 674L, 678L, 683L,
708L, 714L, 824L, 964L, 977L, 1002L, 1006L, 1017L, 1105L, 1113L,
1128L, 1211L, 1248L, 1262L, 1358L, 1373L, 1410L, 1419L, 1449L,
1476L, 1487L, 1515L, 1523L, 1530L, 1535L, 1604L, 1644L, 1663L,
1667L, 1677L, 1688L, 1689L, 1694L, 1772L, 1779L, 1784L, 1802L,
1809L, 1824L, 1848L, 1890L, 1916L, 1967L, 1973L, 2016L, 2017L,
2048L, 2062L, 2075L, 2094L, 2098L, 2108L, 2131L, 2135L, 2144L,
2177L, 2185L, 2266L, 2267L, 2307L, 2335L, 2406L, 2410L, 2442L,
2474L, 2477L), Region = structure(c(5L, 5L, 9L, 11L, 3L, 7L,
2L, 7L, 7L, 2L, 2L, 4L, 1L, 11L, 5L, 11L, 10L, 4L, 2L, 5L, 13L,
13L, 2L, 1L, 3L, 8L, 5L, 4L, 5L, 4L, 12L, 6L, 2L, 5L, 6L, 13L,
12L, 11L, 10L, 7L, 2L, 8L, 13L, 9L, 12L, 7L, 13L, 2L, 8L, 4L,
13L, 4L, 10L, 9L, 4L, 5L, 2L, 5L, 11L, 7L, 5L, 8L, 3L, 2L, 3L,
12L, 13L, 1L, 13L, 1L, 2L, 4L, 12L, 2L, 13L, 2L, 3L, 9L, 2L,
2L, 13L, 5L, 13L, 10L, 12L, 2L, 4L, 2L, 5L, 10L, 1L, 5L, 10L,
2L, 7L, 4L, 13L, 6L, 10L, 6L), .Label = c("Aalst-Oudenaarde",
"Antwerpen-Boom", "Brugge", "Gent", "Hasselt", "Kortrijk-Roeselare",
"Leuven", "Mechelen", "Oostende-Westhoek", "Sint-Niklaas-Dendermonde",
"Tongeren", "Turnhout", "Vilvoorde"), class = "factor"), Education_level =
structure(c(4L,
17L, 4L, 14L, 8L, 13L, 17L, 17L, 1L, 16L, 13L, 17L, 4L, 1L, 16L,
1L, 13L, 13L, 8L, 8L, 17L, 17L, 11L, 11L, 11L, 17L, 6L, 17L,
1L, 17L, 11L, 17L, 17L, 17L, 11L, 17L, 8L, 9L, 11L, 4L, 8L, 14L,
17L, 17L, 11L, 8L, 4L, 17L, 3L, 17L, 3L, 17L, 17L, 4L, 1L, 4L,
16L, 11L, 9L, 16L, 8L, 17L, 8L, 3L, 3L, 17L, 17L, 17L, 17L, 3L,
17L, 11L, 8L, 17L, 17L, 13L, 17L, 17L, 13L, 13L, 13L, 13L, 17L,
17L, 4L, 13L, 11L, 6L, 4L, 8L, 17L, 14L, 17L, 9L, 8L, 17L, 3L,
17L, 3L, 17L), .Label = c("1Primary Education/1th Degree Secondary
Education",
"2nd Degree Artistic Secondary Education", "2nd Degree Technical Secondary
Education",
"2nd Degree Vocational Secondary Education", "2Primary Education/1th
Degree Secondary Education",
"3Primary Education/1th Degree Secondary Education", "3th Degree Artistic
Secondary Education",
"3th Degree Technical Secondary Education", "3th Degree Vocational
Secondary Education",
"4th Degree Vocational Secondary Education (7years)", "5Primary
Education/1th Degree Secondary Education",
"71", "7Primary Education/1th Degree Secondary Education", "8Primary
Education/1th Degree Secondary Education",
"Extraordinary Secondary Education", "Master Degree", "Primary
Education/1th Degree Secondary Education"
), class = "factor"), Age = c(56L, 55L, 55L, 61L, 55L, 59L, 55L,
55L, 56L, 59L, 56L, 57L, 56L, 57L, 58L, 55L, 55L, 57L, 57L, 58L,
57L, 59L, 55L, 56L, 57L, 59L, 59L, 62L, 55L, 56L, 56L, 55L, 57L,
56L, 63L, 55L, 56L, 55L, 57L, 59L, 55L, 56L, 55L, 56L, 55L, 57L,
56L, 55L, 56L, 55L, 56L, 59L, 57L, 55L, 59L, 56L, 58L, 56L, 55L,
60L, 58L, 58L, 55L, 55L, 55L, 55L, 55L, 56L, 55L, 55L, 57L, 57L,
55L, 60L, 56L, 56L, 57L, 56L, 55L, 61L, 62L, 55L, 57L, 55L, 55L,
59L, 60L, 57L, 55L, 57L, 59L, 57L, 57L, 56L, 63L, 56L, 55L, 55L,
57L, 58L), Driver_License = structure(c(7L, 5L, 5L, 5L, 5L, 5L,
1L, 1L, 5L, 5L, 5L, 1L, 9L, 5L, 5L, 5L, 7L, 5L, 5L, 5L, 1L, 5L,
5L, 5L, 1L, 5L, 5L, 1L, 5L, 1L, 5L, 7L, 1L, 5L, 5L, 5L, 9L, 5L,
7L, 9L, 9L, 5L, 5L, 5L, 5L, 5L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 10L,
5L, 5L, 5L, 5L, 5L, 7L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 1L, 1L, 7L,
1L, 5L, 5L, 5L, 5L, 7L, 5L, 5L, 5L, 5L, 5L, 5L, 1L, 1L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 9L, 5L, 1L, 5L, 5L, 7L), .Label = c("",
"A", "A2", "A3", "B", "BE", "C", "C1", "CE", "D", "D1", "DE",
"E", "G"), class = "factor"), Transportation = structure(c(3L,
3L, 1L, 3L, 1L, 1L, 6L, 6L, 3L, 3L, 1L, 4L, 3L, 1L, 1L, 3L, 3L,
3L, 1L, 1L, 6L, 3L, 1L, 3L, 6L, 3L, 3L, 1L, 3L, 6L, 3L, 1L, 6L,
3L, 3L, 1L, 3L, 1L, 3L, 3L, 3L, 1L, 1L, 3L, 3L, 3L, 6L, 6L, 3L,
3L, 3L, 3L, 1L, 3L, 1L, 3L, 3L, 3L, 6L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 6L, 6L, 3L, 6L, 3L, 3L, 1L, 3L, 3L, 1L, 1L, 1L, 3L, 3L,
3L, 6L, 6L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 3L, 3L, 1L, 1L, 6L,
3L, 3L, 3L), .Label = c("", "Bicycle", "Car", "Moped", "Motorbike",
"Public Transportation", "Uknown Transportation Method"), class =
"factor"),
Knowledge_Dutch = structure(c(3L, 2L, 1L, 2L, 3L, 4L, 2L,
3L, 4L, 4L, 4L, 3L, 2L, 3L, 4L, 3L, 4L, 4L, 4L, 3L, 3L, 3L,
4L, 4L, 3L, 3L, 4L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 3L, 4L, 3L,
4L, 4L, 3L, 4L, 4L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 3L, 3L, 3L,
3L, 3L, 3L, 4L, 4L, 4L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 4L, 4L,
3L, 3L, 3L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 3L, 4L, 4L, 2L,
3L, 3L, 3L, 4L, 4L, 3L, 3L, 4L, 3L, 4L, 2L, 4L, 3L, 4L, 3L,
3L, 3L, 3L), .Label = c("0", "1", "2", "3"), class = "factor"),
Immigrant = c(0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
Sex = c(TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE,
TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE,
FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE,
FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE,
FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE,
TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE,
TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE,
TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE),
unemployment_time = c(1L, 33L, 9L, 39L, 2L, 6L, 81L, 79L,
7L, 2L, 14L, 4L, 1L, 82L, 12L, 36L, 4L, 6L, 1L, 1L, 5L, 53L,
18L, 5L, 2L, 1L, 3L, 5L, 3L, 1L, 21L, 23L, 18L, 41L, 2L,
16L, 15L, 3L, 1L, 4L, 1L, 16L, 25L, 8L, 44L, 12L, 1L, 25L,
24L, 23L, 15L, 6L, 2L, 35L, 11L, 6L, 4L, 32L, 44L, 3L, 2L,
6L, 8L, 13L, 1L, 1L, 31L, 25L, 3L, 35L, 13L, 2L, 2L, 3L,
8L, 19L, 7L, 1L, 17L, 2L, 3L, 32L, 1L, 6L, 1L, 11L, 2L, 9L,
34L, 1L, 4L, 7L, 17L, 17L, 9L, 1L, 25L, 2L, 2L, 3L), censor = c(1L,
0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L,
1L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 0L,
1L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 0L,
1L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 0L,
0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L,
0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 1L)), row.names = c(NA, 100L
), class = "data.frame")