-1

I am trying to gather summary statistics of a variable (diffdays) when the variable "disease" is equal to Malaria.

My code for this is:

summary(deathdata$diffdays, deathdata$disease == "Malaria")

This doesn't seem to be working the way I'd like but am I close? Any help is appreciated.

1 Answers1

3

I don't have access to your data but using the built-in mtcars data I would summarize mpg with summary(mtcars$mpg). If I wanted to limit my summary to just those cars with six cylinders I'd subset the data in my call to summary: summary(mtcars[mtcars$cyl == 6, ]$mpg).

rdelrossi
  • 1,114
  • 1
  • 7
  • 17
  • 1
    Thank you @rdelrossi! I used what you did: `summary(deathdata[deathdata$DISEASE == "Malaria",]$diffdays)` It worked perfectly! Appreciate your help! –  Feb 15 '22 at 05:00