I'm creating a cure model in R to predict Loan Default. I'm seeking someone to help me debug this error. I think it may have to do with my columns.
library(smcure)
smcure(Surv(DURATION, DEFAULT) ~ CHK_ACCT+HISTORY+NEW_CAR+USED_CAR+FURNITURE+`RADIO/TV`+EDUCATION+
RETRAINING+AMOUNT+SAV_ACCT+EMPLOYMENT+INSTALL_RATE+MALE_DIV+MALE_SINGLE+MALE_MAR_or_WID+
`CO-APPLICANT`+GUARANTOR+PRESENT_RESIDENT+REAL_ESTATE+PROP_UNKN_NONE+AGE+OTHER_INSTALL+RENT+
OWN_RES+NUM_CREDITS+JOB+NUM_DEPENDENTS+TELEPHONE+FOREIGN,
cureform=~CHK_ACCT+HISTORY+NEW_CAR+USED_CAR+FURNITURE+`RADIO/TV`+EDUCATION+RETRAINING+AMOUNT+SAV_ACCT+
EMPLOYMENT+INSTALL_RATE+MALE_DIV+MALE_SINGLE+MALE_MAR_or_WID+`CO-APPLICANT`+GUARANTOR+PRESENT_RESIDENT+
REAL_ESTATE+PROP_UNKN_NONE+AGE+OTHER_INSTALL+RENT+OWN_RES+NUM_CREDITS+JOB+NUM_DEPENDENTS+
TELEPHONE+FOREIGN,
model="ph", data = CD)
Error in while (convergence > eps & i < emmax) { :
missing value where TRUE/FALSE needed
Does anyone know what this error may mean?
Attached I have a subset of the data I used.
Data
structure(list(CHK_ACCT = c(0, 1, 3, 0, 0, 3, 3, 1, 3, 1, 1,
0, 1, 0, 0, 0, 3, 0, 1, 3, 3, 0, 0, 1, 3, 0, 3, 2, 1, 0, 1, 0,
1, 3, 2, 1, 3, 2, 2, 1, 3, 1, 1, 0, 0, 3, 3, 0, 3, 3, 1, 1, 3,
3, 1, 3, 1, 3, 2, 0, 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 3, 0, 1,
0, 0, 0, 1, 3, 1, 3, 3, 3, 0, 0, 3, 1, 1, 0, 0, 3, 0, 3, 2, 1,
1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 0, 1, 1, 2, 1, 3, 0, 3,
0, 0, 0, 1, 0, 3, 3, 2, 1, 0, 0, 1, 1, 0, 1, 0, 3, 3, 3, 3, 3,
1, 1, 2, 2, 1, 0, 0, 3, 1, 0, 3, 0, 3, 3, 3, 2, 1, 1, 0, 0, 0,
1, 3, 3, 3, 3, 1, 3, 3, 0, 1, 3, 1, 0, 3, 1, 1, 0, 3, 0, 0, 3,
0, 3, 1, 0, 3, 1, 3, 1, 1, 0, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1
), DURATION = c(6, 48, 12, 42, 24, 36, 24, 36, 12, 30, 12, 48,
12, 24, 15, 24, 24, 30, 24, 24, 9, 6, 10, 12, 10, 6, 6, 12, 7,
60, 18, 24, 18, 12, 12, 45, 48, 18, 10, 9, 30, 12, 18, 30, 48,
11, 36, 6, 11, 12, 24, 27, 12, 18, 36, 6, 12, 36, 18, 36, 9,
15, 36, 48, 24, 27, 12, 12, 36, 36, 36, 7, 8, 42, 36, 12, 42,
11, 54, 30, 24, 15, 18, 24, 10, 12, 18, 36, 18, 12, 12, 12, 12,
24, 12, 54, 12, 18, 36, 20, 24, 36, 6, 9, 12, 24, 18, 12, 24,
14, 6, 15, 18, 36, 12, 48, 42, 10, 33, 12, 21, 24, 12, 10, 18,
12, 12, 12, 12, 12, 48, 36, 15, 18, 60, 12, 27, 12, 15, 12, 6,
36, 27, 18, 21, 48, 6, 12, 36, 18, 6, 10, 36, 24, 24, 12, 9,
12, 24, 6, 24, 18, 15, 10, 36, 6, 18, 11, 24, 24, 15, 12, 24,
8, 21, 30, 12, 6, 12, 21, 36, 36, 21, 24, 18, 15, 9, 16, 12,
18, 24, 48, 27, 6, 45, 9, 6, 12, 24, 18), HISTORY = c(4, 2, 4,
2, 3, 2, 2, 2, 2, 4, 2, 2, 2, 4, 2, 2, 4, 0, 2, 2, 4, 2, 4, 4,
4, 2, 0, 1, 2, 3, 2, 2, 2, 4, 2, 4, 4, 2, 2, 2, 2, 2, 3, 4, 4,
4, 2, 2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, 0, 0, 0, 0), AMOUNT = c(1169,
5951, 2096, 7882, 4870, 9055, 2835, 6948, 3059, 5234, 1295, 4308,
1567, 1199, 1403, 1282, 2424, 8072, 12579, 3430, 2134, 2647,
2241, 1804, 2069, 1374, 426, 409, 2415, 6836, 1913, 4020, 5866,
1264, 1474, 4746, 6110, 2100, 1225, 458, 2333, 1158, 6204, 6187,
6143, 1393, 2299, 1352, 7228, 2073, 2333, 5965, 1262, 3378, 2225,
783, 6468, 9566, 1961, 6229, 1391, 1537, 1953, 14421, 3181, 5190,
2171, 1007, 1819, 2394, 8133, 730, 1164, 5954, 1977, 1526, 3965,
4771, 9436, 3832, 5943, 1213, 1568, 1755, 2315, 1412, 1295, 12612,
2249, 1108, 618, 1409, 797, 3617, 1318, 15945, 2012, 2622, 2337,
7057, 1469, 2323, 932, 1919, 2445, 11938, 6458, 6078, 7721, 1410,
1449, 392, 6260, 7855, 1680, 3578, 7174, 2132, 4281, 2366, 1835,
3868, 1768, 781, 1924, 2121, 701, 639, 1860, 3499, 8487, 6887,
2708, 1984, 10144, 1240, 8613, 766, 2728, 1881, 709, 4795, 3416,
2462, 2288, 3566, 860, 682, 5371, 1582, 1346, 1924, 5848, 7758,
6967, 1282, 1288, 339, 3512, 1898, 2872, 1055, 1262, 7308, 909,
2978, 1131, 1577, 3972, 1935, 950, 763, 2064, 1414, 3414, 7485,
2577, 338, 1963, 571, 9572, 4455, 1647, 3777, 884, 1360, 5129,
1175, 674, 3244, 4591, 3844, 3915, 2108, 3031, 1501, 1382, 951,
2760, 4297), SAV_ACCT = c(4, 0, 0, 0, 0, 4, 2, 0, 3, 0, 0, 0,
0, 0, 0, 1, 4, 4, 0, 2, 0, 2, 0, 1, 4, 0, 0, 3, 0, 0, 3, 0, 1,
4, 0, 0, 0, 0, 0, 0, 2, 2, 0, 1, 0, 0, 2, 2, 0, 1, 4, 0, 0, 4,
0, 4, 4, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 3, 0, 4, 0, 4, 0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 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 1, 1), AGE = c(67, 22, 49, 45, 53, 35,
53, 35, 61, 28, 25, 24, 22, 60, 28, 32, 53, 25, 44, 31, 48,
44, 48, 44, 26, 36, 39, 42, 34, 63, 36, 27, 30, 57, 33, 25,
31, 37, 37, 24, 30, 26, 44, 24, 58, 35, 39, 23, 39, 28, 29,
30, 25, 31, 57, 26, 52, 31, 23, 23, 27, 50, 61, 25, 26, 48,
29, 22, 37, 25, 30, 46, 51, 41, 40, 66, 34, 51, 39, 22, 44,
47, 24, 58, 52, 29, 27, 47, 30, 28, 56, 54, 33, 20, 54, 58,
61, 34, 36, 36, 41, 24, 24, 35, 26, 39, 39, 32, 30, 35, 31,
23, 28, 25, 35, 47, 30, 27, 23, 36, 25, 41, 24, 63, 27, 30,
40, 30, 34, 29, 24, 29, 27, 47, 21, 38, 27, 66, 35, 44, 27,
30, 27, 22, 23, 30, 39, 51, 28, 46, 42, 38, 24, 29, 36, 20,
48, 45, 38, 34, 36, 30, 36, 70, 36, 32, 33, 20, 25, 31, 33,
26, 34, 33, 26, 53, 42, 52, 31, 65, 28, 30, 40, 50, 36, 31,
74, 68, 20, 33, 54, 34, 36, 29, 21, 34, 28, 27, 36, 40),
OTHER_INSTALL = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 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, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0,
1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0,
1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1)), row.names = c(NA,
-200L), class = c("tbl_df", "tbl", "data.frame"))
I have the following model and calculated the predicted probabilities:
( all variables are binary (0, 1) except AED_pre which is numeric (0:4)
modelfit <-glm(engelone ~ generalized + SEEG+ Aura + AED_pre + MS, data=data)
summary(modelfit)
prob <-predict(modelfit, type = c("response"))
I used SPSS to obtain the ROC curve, but I still need the calibration plots (+bootstrapping). I tried with:
val <- val.prob(data$prob, data$engelone, pl = TRUE)
but i get this error:
Error in qlogis(p) : Non-numeric argument to mathematical function
What should i do? Thanks!
Here's my data :
structure(list(generalized = c(0, 1, 1, 0, 0, 1, 0, 0, 1, 1,
0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1,
0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1,
1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0,
0, 0, 1, 1, 0, 1, 1, 0, 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, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 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,
0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1)), .Names = c("generalized",
"Aura", "AED_pre", "SEEG", "MS", "engelone"), row.names = c(NA,
-316L), class = c("tbl_df", "tbl", "data.frame"))
Maybe you have to see what variable class you have in your database, you can see it with class() and be sure you have numeric or factor variables. could try with this.
Given is the following data frame:
structure(list(UH6401 = c(1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0,
1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0,
1, 0, 1, 1), UH6402 = c(1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1,
0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0,
1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0,
0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,
1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1,
0, 1, 1), UH6403 = c(1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1,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1, 1, 0, 1, 0, 0,
0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1,
1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0,
1, 0, 1, 1), UH6407a = c(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1,
1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1), weight = c(405.002592353822,
479.360356183825, 526.548105855472, 810.005184707644, 312.321528531308,
930.961115757095, 567.383058387095, 475.323944260643, 1226.91439266118,
517.086839792615, 1200.2669656949, 810.005184707644, 656.723784884795,
605.370463928298, 668.467435759576, 558.112457492436, 793.751055244424,
479.360356183825, 1226.91439266118, 1606.54816212786, 1657.48609449633,
300.803580980276, 605.370463928298, 1140.55078447979, 669.102760422943,
810.005184707644, 1657.48609449633, 305.569853371963, 2994.30343152033,
762.922030382216, 479.360356183825, 1147.36030437824, 668.467435759576,
517.086839792615, 479.360356183825, 399.141865860217, 656.723784884795,
913.364738988386, 312.321528531308, 569.10576379231, 775.630259688922,
1207.22952429547, 1053.09621171094, 1140.55078447979, 314.857225320909,
668.467435759576, 2416.57081451012, 573.680152189121, 396.875527622212,
605.370463928298, 1036.3159447043, 3088.62283807823, 569.10576379231,
1140.55078447979, 2416.57081451012, 1147.36030437824, 762.922030382216,
702.064141140629, 351.032070570315, 629.714450641817, 517.086839792615,
1996.20228768022, 828.743047248167, 475.323944260643, 920.185794495882,
793.751055244424, 796.08788273764, 1197.42559758065, 405.002592353822,
418.584343119327, 300.803580980276, 654.76828203733, 2740.09421696516,
351.032070570315, 1069.6202614693, 2094.91447516374, 399.141865860217,
654.76828203733, 1003.65414063441, 573.680152189121, 851.074587580641,
913.364738988386, 762.922030382216, 1034.17367958523, 573.680152189121,
479.360356183825, 3208.8607844079, 654.76828203733, 908.055695892447,
328.361892442398, 1036.3159447043, 702.064141140629, 613.457196330588,
601.607161960551, 567.383058387095, 479.360356183825, 306.261087672466,
920.185794495882, 654.76828203733, 828.743047248167)), .Names = c("UH6401",
"UH6402", "UH6403", "UH6404", "UH6409", "UH6410", "UH6411", "UH6412",
"UH6503", "UH66", "UH68", "UH6501a", "UH6405a", "UH6407a", "weight"
), row.names = c(NA, 100L), class = "data.frame")
In social science we often have a weight variable to weight a case (row) by the factor of that variable to correct the sample to fit e.g. the population by age classes. If the weight variable of a row is "1.6" it means that this row need do be observed 1.6 times to fit the basis population.
In SPSS I would write
WEIGHT BY weight.
and all procedures after that command will weight the data accordingly.
In R I can do that with stabs with the command
xtabs(weight ~ UH6401, data=df)
But what if I want to do a SVD or PCA analysis? Here there is no function to weight data like it is in xtabs.
So the question is, is there a method to weight data in R like it is possible in SPSS?
The point with whole numbers would be easy, with the factor "2" we would just double the line, but what is with all the factors that are decimal?
UPDATE:
The SVD or PCA was just an example! Take any other statistical procedure.
In social science the samples are never perfect, but to do an statistical analysis with sample data, the sample needs to represent the basic population, but a sample mostly doesn't. So we try to fix that deficit with weights, so the sample represent the basic population!
First of all, doing PCA on this data doesn't make sense. Second, SPSS does not perform PCA but factor analysis, which is something else. I know they call it PCA, but it isn't.
The WEIGHT BY in SPSS is nothing more than a replication weight, and is exactly the same as doing your analysis by repeating your cases using rep(): complete madness. To link to your example: In SPSS, FACTOR (which is used for the socalled PCA) does not take fractional weights.
If you want to perform weighted procedures, the only sensible way of doing that is using the correct method/function/package for that. In statistics, there is no one-size-fits-all weight procedure, contrary to what SPSS likes to make you believe.
In your example : weighted PCA in R is contained in FactoMineR and aroma.light. But I strongly suggest you take also a look at the vegan package, as that contains a lot more useful ordination methods for the data you're describing.
You probably need to get acquainted with the search engines for R. Baron's RSiteSearch and Rseek:
This is one of the first hits on "weighted PCA" at Baron's site:
http://finzi.psych.upenn.edu/R/library/aroma.light/html/wpca.matrix.html
With the clarification in the comment to Joris Meys response, the answer is often that one needs to be clear that one is desires sample weights versus other types of weighting. Regression weighting is done with the survey package. Lumley's book on survey methods distinguishes among three types of weights. (The "weights" in the lm function are variance weights, NOT sample weights.)
Note: Both PCA and factor analysis (experimental) are included in the survey package. So maybe Dominick's question requestiong a unified approach to weighting in regression methods has a single "answer".
I am not sure if this would suite you. See the R package weights.
I have just found a Post in R-Bloggers which introduces a svydesign() function. As far as I know, this function from the 'survey' package is like SPSS function, allowing you to create a weighted data to use in further analysis. I find it more useful than using different functions from several packages in order to do multivariable analysis.
Note to #djhurio: The answer would have been better with code. It does seem a bit duplicative of my answer which pointed to the survey package that contains 'svydesign'. The cited webpage is still there 4 years later, but that might not always be the case.