plotting nomogram in r

good day!
i'm using rms package to plot a nomogram
I keep getting this message:
Error in nomogram(fit.reg22, fun = plogis, lp = F, nint = 10, maxscale = 100, :
duplicated variable labels: 0 1 0 1
how to deal with it, I have search everywhere and could not find an answer.

Hi there,

Happy to help if you can add some data ( FAQ: How to do a minimal reproducible example ( reprex ) for beginners - #2 by andresrcs ). We can't run your code based on that error message alone.

predicting ALT free flap thickness.
outcome : ALT thickness( continuous outcome)
predictors: age>50, gender, BMI>23(all binary factors)
the predictors were from a linear regression from SPSS
data imported from SPSS to R:
using rms package and following this link example ( Chapter 14 Multiple Imputation and Linear Regression | Data Science for Biological, Medical and Health Research: Notes for 432 (thomaselove.github.io)

-dd <- datadist(thickness_forR_1)
options(datadist = "dd")
-boxcox((ALT.ave + 1) ~ age50+ BMI23+ genderRE, data= thickness_forR_1)

thickness_forR_1 <- thickness_forR_1 %>%
mutate(ALT2 = log(ALT.ave + 1))
-fit.reg22<-ols(ALT2 ~ age50 + BMI23 + genderRE, data=thickness_forR_1, x = TRUE, y = TRUE)
summary(fit.reg22)
plot(summary(fit.reg22))
plot(nomogram(fit.reg22,

  •                fun = list(function(x) exp(x) - 1),
    
  •                funlabel = "ALT.thickness",
    
  •                fun.at = seq(0, 30, 3))) 
    

Error in nomogram(fit.reg22, fun = list(function(x) exp(x) - 1), funlabel = "ALT.thickness", :
duplicated variable labels: 0 1 0 1

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.