Displaying 1 result from an estimated 1 matches for "tp4501504p4501709".
2012 Mar 24
3
How to compute within-group mean and sd?
Hi, I want to run something like
SELECT firm_id, count(*), mean(value), sd(value)
FROM table
GROUP BY firm_id;
But I have to write a for loop like
for ( id in unique(table$firm_id ) {
print(paste( id, mean(table[firm_id == id, "value"]) ))
}
Is there any way to do it easier? Thanks :)
Best,
Reeyarn Lee
[[alternative HTML version deleted]]