using tapply to run a command, in this case calculating the variance of the variable met within each of the categories of the variable coffee consumption (3 categories)
```
tapply(coffee.exercise$met, coffee.exercise$coffee.consumption, var)
```
rowMeans, rowSums, colMeans, colSums, can do similar functions as apply. These are pretty similar to Stata's egen rowmean and rowtotal functions
Below are some examples:
```
colSums(ham, na.rm = T)
colMeans(ham, na.rm = T)
```
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...
-
In linear regression analysis, If the predictor X is the numerical variable "calories", then an increase of X from 10 to 30 will h...
-
Amateur code ``` jad<-function(x, y) { model<-lm(y~x) std.err<-coef(summary(model))[, 2] coef.model1<-coef(summary(model)...