[R] summary stats on continuous data

Matthew Finkbeiner matthew.finkbeiner at gmail.com
Tue Jun 15 12:51:55 CEST 2010


Hi Daniel, thanks for your reply.  Unfortunately, that is not doing what I
need.  In the example I sent, there are three subjects (S1, S2 & S3).  Each
subject has 3 trials worth of data and each trial has 10 samples.  What I
want to return is the accuracy rate for each subject.  The answer is 66.6%
because in this toy example, each subject has 2 correct trials and 1
incorrect trial.

An easy way is to subset the dataframe into correct and incorrect sets for
each subject and then just take the number of correct trials
(length(unique(d$trial)) divided by total trials for that subject.  But
there must be a less clumsy way?  Especially since I need to do this many
times, not just for accuracy, but for other variables/codes in the real
dataset.

thanks again for any help

Matthew


-- 
View this message in context: http://r.789695.n4.nabble.com/summary-stats-on-continuous-data-tp2255496p2255705.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list