[R-es] error en función ggadjustedcurves, paquete survminer

Carlos Ortega cof en qualityexcellence.es
Sab Ene 27 22:46:16 CET 2018


Hola,

Mira el ejemplo de la ayuda:

> library(survival)
> fit2 <- coxph( Surv(stop, event) ~ size, data = bladder )
> # single curve
> ggadjustedcurves(fit2, data = bladder)

Que produce este gráfico.

[image: Imágenes integradas 1]

Solamente tienes que pasar la variable donde guardas el modelo y los datos.

Pero puedes valorar otras opciones, representar las curvas de
supervivencia, estratificadas por otra variable (los grupos, etc, etc).

Saludos,
Carlos Ortega
www.qualityexcellence.es


El 27 de enero de 2018, 15:50, Patricio Suárez Gil <patricsg en gmail.com>
escribió:

> Tengo un modelo de regresión de Cox y quiero obtener el plot ajustado por
> una covariable (sexo) con la función ‘ggadjustedcurves’, pero me da el
> siguiente error:
>
> > cox2 <- coxph(os ~ imc_25 + sexo.1, data = datos)
> > cox2
> Call:
> coxph(formula = os ~ imc_25 + sexo.1, data = datos)
>
>           coef exp(coef) se(coef)     z     p
> imc_25  -0.621     0.537    0.299 -2.08 0.038
> sexo.1M  0.714     2.042    0.387  1.84 0.065
>
> Likelihood ratio test=6.23  on 2 df, p=0.0444
> n= 76, number of events= 54
> > ggadjustedcurves(cox2, variable = datos$sexo.1, data = datos)
> Error in `[.data.frame`(data, , variable) : undefined columns selected
>
> Agradezco cualquier feedback.
>
> Saludos,
>
>
> Patricio
>
>
> Patricio Suárez Gil
> Unidad de Investigación Área V-Gijón
> Planta 5ª Impar
> Hospital Universitario de Cabueñes
> C/Prado, 395
> 33394 Gijón (Asturias)
> Tfno: 985 185 000 (Ext. 85715)
> @uinvest_psg
> unidadinvestigacion.area5 en sespa.es
> ESPAÑA
>
>
>
>
>
>
>
>
>
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-help-es mailing list
> R-help-es en r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es




-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20180127/326cba61/attachment-0001.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 26414 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20180127/326cba61/attachment-0001.png>


Más información sobre la lista de distribución R-help-es