search for: proportionpass

Displaying 1 result from an estimated 1 matches for "proportionpass".

2004 May 26
1
Turning pass/fail results into a proportion
...ns the proportions of pass/fails per variable. So, for example: df <- data.frame( Var=c(3,3,3,4,4), Result=c("pass","fail","fail","pass","pass"), SampleSize=c(3,3,3,2,2)) And I'd like to produce the equivalent of: data.frame( Var=c(3,4), ProportionPass=c(0.33, 1) ) I have found the table() function: table( df$Var, df$Result) which potentially seems to be part of the solution, however it turns the Var column into factors. As an aside, is the storage of SampleSize (above) the best technique? Or is it better to store it in a data frame of its...