Saturday, 31 August 2013

summary table with total whilst controlling for value on one variable?

summary table with total whilst controlling for value on one variable?

I've used function summary(data[data$var1==5,]) to get a summary of
observations while the variable of interest equals 5 (or whatever).
However, I also need a total for a particular var2 as well, and I'm unsure
how to go about coding that in here whilst keeping the variable that I
want controlled at 5 (or whatever).
I'm quite happy writing a second line looking for the total of var2 whilst
controlling var1. Any help would be appreciated, thanks.

No comments:

Post a Comment