R codes and Programming
How to remove NA as a level
by including NA in " " we transform it into a real missing value in an R factor vector
```
HIV_coded$bisexual<- factor(replace(HIV_coded$bisexual, HIV_coded$bisexual == "NA", NA))
```
Newer Post
Older Post
Home
Introduction to the Analysis of Survival Data in the Presence of Competing Risks
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4741409/
Labeling points on scatter plot
In the below example i show how to assign a label (in this case Casenr) to each data point on my scatter plot. ``` plot(BMI~Age, data=pr...
different usages of tapply
using tapply to run a command, in this case calculating the variance of the variable met within each of the categories of the variable coffe...
Regression model with variables with different lengths
Sometimes when you are running a regression model with variables that have different lengths, r will prompt with the following error message...