3

I have a variable, days until release from prison. However, some people have no value for this variable because they have life sentences. So, currently, they count towards NA/missing data. I'm not sure what would be an acceptable way to represent this numerically? If I code them as a character, that would affect the format of the overall variable, correct?

I am using R, and this is a predictor variable

Leen
  • 31
  • Hi: In R you could use an NA numeric but you didn't say what language you were using. – mlofton Dec 07 '22 at 15:42
  • @mlofton Hi, sorry. I'm using R. Could you please give more details? – Leen Dec 07 '22 at 15:48
  • 2
    How are you planning on using this variable: as a predictor or as an outcome? Please provide that information by editing the question, as comments are easy to overlook and can be deleted. – EdM Dec 07 '22 at 15:50
  • thanks @EdM, apologies this is my first time using this forum. – Leen Dec 07 '22 at 15:57
  • 1
    What is the information that you want to learn from the predictor variable? What model are you using? – Sycorax Dec 07 '22 at 16:17
  • 1
    There's life sentencing with eligibility for parole (US, at least). – AdamO Dec 07 '22 at 16:21
  • 1
    There can be ways to handle generally numeric values that don't have possible values in some cases, in a way that includes all cases. See this page, for example. But we'd have to know more about the question you are asking and details of your model to know whether that approach could be applied in your situation. Please edit the question to provide those details so that you can get a helpful answer. – EdM Dec 07 '22 at 16:58
  • @Leen: This link provides all of the gory details. Still, you have to decide how you want to handle them. If you don't want to include those observations, then is.na() is probably what you want. https://stackoverflow.com/questions/46827631/are-there-different-types-of-nas – mlofton Dec 09 '22 at 05:19

0 Answers0