running a command on a subset of data (similar to if condition in stata)
``` hist(coffee.exercise$met[coffee.exercise$coffee.consumption=="A"])
hist(coffee.exercise$met[coffee.exercise$coffee.consumption=="B"])
hist(coffee.exercise$met[coffee.exercise$coffee.consumption=="C"])
hist(coffee.exercise$met[coffee.exercise$coffee.consumption=="D"])
````
Introduction to the Analysis of Survival Data in the Presence of Competing Risks
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4741409/
-
Sometimes when you are running a regression model with variables that have different lengths, r will prompt with the following error message...
-
``` library(memisc) labels(anemia$anem)<-c("not anemic"=0, "anemic"=1) #library memisc ```