Cognitive Semiotics
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Lego Report] Accuracy as a function of Condition

3 posters

Go down

[Lego Report] Accuracy as a function of Condition Empty [Lego Report] Accuracy as a function of Condition

Post by Santiak Mon Mar 28, 2016 4:37 pm

Note that I've named my dataframe (where all the data is located) "AllData", remember to replace it with whatever you've called your own dataframe Smile

To get the graph:
ggplot(AllData, aes(x=Accuracy==1, fill=Condition)) + geom_bar(position="dodge")

Which gives you a bar-graph depicting the distribution of correct/incorrect answers, divided between Individual and Collective conditions.

Because I wasn't able to get R to pay attention, I opted to go a slightly different route and calculate the percentages myself, as I couldn't get R to implement the percentages on the graph itself for the sake of clarity and accuracy.
To do this, you can assign all values of a specific condition to a new dataframe:


> m <- AllData[AllData$Condition!="Collective",]
> n <- AllData[AllData$Condition!="Individual",]


This creates 2 new dataframes by telling R to move all values that are not Collective (m) or Individual (n) into a new box, splitting the two so we can more easily get a good look at them seperately.
Just to clarify:
"m" has all the individual condition results (because the code specifies '!="Collective"', or in good ol' English, "Not equal to Collective"
"n" has the reverse, obviously.

You can then do a summary of the new sets, giving you the amount of answers:

> summary(m$Accuracy==1)
> summary(n$Accuracy==1)

Keep in mind we only want to see the values relating to Accuracy, so to avoid it throwing everything it has at us, we add in "$Accuracy==1", telling it to show us the subset Accuracy, and how many of them are correct(1), i.e. TRUE = Correct, FALSE = Incorrect.

It returns (for "m", Individual):
  Mode   FALSE    TRUE    NA's
logical    2065    1295     304

And with that, we can calculate the percentage, excluding NA values:
> 2065+1295
[1] 3360
> 1295/3360*100
[1] 38.54167

That is:
> FALSE+TRUE
= TOTAL
> TRUE/TOTAL*100
= PERCENT TRUE

Santiak
Admin

Posts : 23
Join date : 2016-02-24

Back to top Go down

[Lego Report] Accuracy as a function of Condition Empty Re: [Lego Report] Accuracy as a function of Condition

Post by tobi-wan kenobi Fri Apr 01, 2016 8:51 am

Thanks! In addition to the latest post this is worth its weight in gold (good this is virtual data cause i dont have any gold to give you). Thanks for putting all this up!

tobi-wan kenobi

Posts : 7
Join date : 2016-03-10

Back to top Go down

[Lego Report] Accuracy as a function of Condition Empty Re: [Lego Report] Accuracy as a function of Condition

Post by alinemeret Fri Apr 01, 2016 9:59 am

MADS our hero!

[Lego Report] Accuracy as a function of Condition <a href=[Lego Report] Accuracy as a function of Condition Holyfu10" />

alinemeret

Posts : 4
Join date : 2016-03-02

Back to top Go down

[Lego Report] Accuracy as a function of Condition Empty Re: [Lego Report] Accuracy as a function of Condition

Post by Santiak Fri Apr 01, 2016 10:02 am

[Lego Report] Accuracy as a function of Condition Latest?cb=20130525214956

Santiak
Admin

Posts : 23
Join date : 2016-02-24

Back to top Go down

[Lego Report] Accuracy as a function of Condition Empty Re: [Lego Report] Accuracy as a function of Condition

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum