[R] assistant

peter dalgaard pdalgd at gmail.com
Tue Apr 16 13:24:29 CEST 2013


Looks like sumassure is treated as categorical. This sort of thing is usually a data error; it happens if one of the values can not be converted to numeric, O instead of 0, comma instead of period, etc.

Check summary(X), or, to investigate more specifically, things like

x <- X$sumassure
table(x[is.na(as.numeric(x))])

-pd 

On Apr 16, 2013, at 11:31 , Adelabu Ahmmed wrote:

> Dear Sir/Ma,
> 
> I Adelabu.A.A, one of the R-users from Nigeria. When am running a coxph command the below error was generated, and have try some idea but not going through. kindly please assist:
> 
>> cox1   <- coxph(Surv(tmonth,status) ~ sex +  age + marital + sumassure, X)
> Warning message:
> In fitter(X, Y, strats, offset, init, control, weights = weights,  :
>  Ran out of iterations and did not converge
> 
>> summary(cox1, conf.int=0.95, exact = TRUE)
> Call:
> coxph(formula = Surv(tmonth, status) ~ sex + age + marital + 
>    sumassure, data = X)
> 
>  n= 5958, number of events= 316 
> 
>                           coef  exp(coef)   se(coef)      z Pr(>|z|)   
> sex                  -1.418e-01  8.678e-01  1.743e-01 -0.814  0.41593   
> age                   1.492e-03  1.001e+00  1.369e-03  1.090  0.27593   
> marital               4.283e-01  1.535e+00  2.201e-01  1.946  0.05165 . 
> sumassure10000       -1.553e+01  1.795e-07  3.699e+03 -0.004  0.99665   
> sumassure100000      -7.357e-01  4.792e-01  1.156e+00 -0.636  0.52467   
> sumassure1000000     -1.556e+01  1.747e-07  5.556e+02 -0.028  0.97766   
> sumassure1000800     -1.549e+01  1.874e-07  4.062e+03 -0.004  0.99696   
> sumassure1002000     -1.564e+01  1.607e-07  2.408e+03 -0.006  0.99482   
> sumassure1008000     -1.562e+01  1.650e-07  3.225e+03 -0.005  0.99614   
> sumassure10080000    -1.541e+01  2.028e-07  7.148e+03 -0.002  0.99828   
> sumassure1014673.1   -1.543e+01  1.988e-07  6.218e+03 -0.002  0.99802   
> sumassure101737.03    1.186e+00  3.275e+00  1.418e+00  0.836  0.40288   
> sumassure101850.55    1.054e+00  2.870e+00  1.418e+00  0.743  0.45731   
> sumassure102000       4.671e-02  1.048e+00  1.416e+00  0.033  0.97369   
> sumassure1020000     -1.525e+01  2.375e-07  3.578e+03 -0.004  0.99660   
> sumassure1027251.36  -1.568e+01  1.557e-07  3.699e+03 -0.004  0.99662   
> sumassure1035360.53  -1.542e+01  2.015e-07  6.961e+03 -0.002  0.99823   
> sumassure1043436.77  -1.547e+01  1.905e-07  5.366e+03 -0.003  0.99770   
> sumassure1043438.77  -1.547e+01  1.908e-07  1.981e+03 -0.008  0.99377   
> sumassure10482402.52 -1.567e+01  1.560e-07  3.699e+03 -0.004  0.99662   
> sumassure105000      -1.556e+01  1.755e-07  3.493e+03 -0.004  0.99645   
> sumassure1050000     -1.562e+01  1.644e-07  3.293e+03 -0.005  0.99622   
> sumassure1052631.57  -1.555e+01  1.764e-07  4.870e+03 -0.003  0.99745   
> sumassure1056363.94  -1.498e+01  3.123e-07  7.384e+03 -0.002  0.99838   
> sumassure1059480     -1.555e+01  1.763e-07  1.589e+03 -0.010  0.99219   
> sumassure1073559.38  -1.551e+01  1.842e-07  5.238e+03 -0.003  0.99764   
> sumassure108000       2.147e+00  8.558e+00  1.420e+00  1.512  0.13056   
> sumassure1080000     -2.121e+00  1.200e-01  1.226e+00 -1.730  0.08367 . 
> sumassure10800000    -1.532e+01  2.215e-07  2.657e+03 -0.006  0.99540   
> sumassure1081137.2   -1.534e+01  2.182e-07  4.921e+03 -0.003  0.99751   
> sumassure108591.75    1.126e+00  3.084e+00  1.418e+00  0.794  0.42705   
> sumassure1100000     -1.553e+01  1.803e-07  3.699e+03 -0.004  0.99665   
> sumassure11121828.15 -1.526e+01  2.351e-07  6.735e+03 -0.002  0.99819   
> sumassure111417.02    1.042e+00  2.836e+00  1.418e+00  0.735  0.46240   
> sumassure1116251.83   2.065e+00  7.889e+00  1.421e+00  1.454  0.14595   
> sumassure1122821.57  -1.567e+01  1.569e-07  3.699e+03 -0.004  0.99662   
> ...
> 
> Concordance= 0.781  (se = 0.018 )
> Rsquare= 0.119   (max possible= 0.577 )
> Likelihood ratio test= 752.4  on 526 df,   p=2.95e-10
> Wald test            = 655.2  on 526 df,   p=0.000101
> Score (logrank) test = 2262  on 526 df,   p=0
> 
> 
> The sumassure is a sum assured amount of policy holder in insurance.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list