`cox_model <- coxph(Surv(csd_days, csd_event) ~ Age_10yr + Sex_male +
Hypertension +Diabetes + ESRD_or_CKD + Ischemic_stroke_or_TIA +
Previous_MI + Dyslipidemia + Malignancy_history +
Thyroid_disease + Heart_failure + Alcohol
+ Physical_Activity + Smoking + BMI, data=old_total4)`
This is my initial code.
And this is the result.
enter image description here
I’d like to make 2 changes.
- I want to change the variables names
Age_10yr to Age(10yr)
Sex_male to Sex(male)
Previous_MI to Previous MI
like, removing the _ from the variable and change it to () or blank.
I’ve tried to do it like this…
`cox_model <- coxph(Surv(csd_days, csd_event) ~ Age(10yr) + Sex(male) +
Hypertension +Diabetes + ESRD or CKD + Ischemic stroke or TIA +
Previous MI + Dyslipidemia + Malignancy history +
Thyroid disease + Heart failure + Alcohol
+ Physical Activity + Smoking + BMI, data=old_total4)`
It didn’t work, so I thought maybe adding ‘ ‘ could work…
for example, Age(10yr) -> ‘Age(10yr)’ in that code
-> but it didn’t work also.
- In the image I’ve uploaded, the numbers are like 1.2, 1.4, 1.6…
I’d like to change the range from 0.5 ~ 2
(I mean, so that the ratio is from half to twice.. like logarithmic??
I’ve also actually done things like this:
`labelled::var_label(old_total4) <- list(
Age_10yr="Age(10yr)",
Sex_male="Sex(male)",
Hypertension="Hypertension",
Diabetes="Diabetes",
ESRD_or_CKD="ESRD or CKD",
Ischemic_stroke_or_TIA="Ischemic stroke or TIA",
Previous_MI="Previous MI",
Dyslipidemia="Dyslipidemia",
Malignancy_history="Malignancy history",
Thyroid_disease="Thyroid disease",
Heart_failure="Heart failure",
Alcohol="Alcohol",
Physical_Activity="Physical Activity",
Smoking="Smoking",
BMI="BMI"
)`
`cox_model$xlevels <- unname(cox_model$xlevels)
print(forest_model(cox_model))`
`ggforest(coxph, data=old_total4, legend.labs=c("Age(10yr)", "Sex(male)", "Hypertension",
"Diabetes", "ESRD or CKD", "Ischemic stroke or TIA",
"Previous MI", "Dyslipidemia", "Malignancy history",
"Thyroid disease", "Heart failure", "Alcohol",
"Physical Activity", "Smoking", "BMI"))`
I’ve searched this from google and it led to me this site, so I applied it to my code…
and it said,unused arguments
윤상곤 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.