Relative Content

Tag Archive for rlinear-regressionmedical

How do I get a medical linear regression model in R to ignore NA values that result from patients not taking every test?

I am building a simple linear regression model to be used in neuropsychology offices that takes patient data from cognitive testing, compares it to past patient data/diagnosis, and predicts a statistical analysis of what disease a patient has (Parkinson’s or Alzheimer’s). The issue is that when I go to use the “train” function, the model can’t compute it because every patient has multiple “NA” values from not taking that specific test. I need the model to compute it anyway because we can’t have every patient take every test, but it keeps defaulting to the “accuracy” metric, which cannot be calculated since every patient has missing values. I also can’t input a constant to replace any missing values because doing so would warp the cognitive diagnosis, as it is possible for a patient to legitimately score a 0 on a test, indicating a severe memory deficiency. I have tried multiple custom metrics to work around the default “accuracy” metric, but it won’t work. I’ve tried: