a6Ans

pdf

School

University of California, Irvine *

*We aren’t endorsed by this school

Course

10A

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

4

Uploaded by ProfessorWolfPerson1007

Report
Assignment 6 Answers Valeria Ramos This is an individual-based assignment. I affirm that I have not copied code from another student in the class. link <- "https://raw.githubusercontent.com/PerceptionCognitionLab/data0/master/lexDec-dist5/ld5.all" dat <- read.table ( url (link), head= FALSE ) colnames (dat) <- c ( "sub" , "block" , "trial" , "stim" , "resp" , "rt" , "err" ) dig <- c ( 2 , 3 , 4 , 6 , 7 , 8 ) dat $ digit <- dig[dat $ stim + 1 ] dat $ totTrial <- dat $ block * 60 + dat $ trial + 1 badSub <- dat $ sub %in% c ( 34 , 43 ) errs <- dat $ err == 1 tooFast <- dat $ rt < 200 tooSlow <- dat $ rt > 2000 warm <- dat $ totTrial < 20 first <- dat $ trial == 0 badRows <- badSub | errs | tooFast | tooSlow | warm | first clean = dat[ ! badRows,] clean $ sub <- as.integer ( as.factor (clean $ sub)) link = ' https://raw.githubusercontent.com/PerceptionCognitionLab/data0/master/lexDec-dist5/loadData.R ' source ( url (link)) clean <- loadData () mrtByDigitPerson <- tapply (clean $ rt, list (clean $ digit,clean $ sub),mean) 1. Plot the mean response time of the cleaned data as a function of digit. dig <- c ( 2 , 3 , 4 , 6 , 7 , 8 ) rtmeans <- tapply (clean $ rt, clean $ digit, mean) plot (dig, rtmeans, col = ' hotpink ' , type = "b" , xlab = "Digits" , ylab = "Response Time (ms)" ) 1
2 3 4 5 6 7 8 590 600 610 620 630 640 Digits Response Time (ms) 2. Let’s look at mrtByDigitPerson . It is a matrix. How many rows? How many columns? What are the rows? What are the columns? What do the values in the matrix represent? dim (mrtByDigitPerson) ## [1] 6 52 There are 6 rows and 52 columns. The rows are the digits and the columns are the subjects, the values in the matrix represent the mean of response times by digit for each participant in the experiment. 3. Plot the mean effects with a separate line for each participant. mrtByperson <- tapply (clean $ rt,clean $ sub,mean) effect <- clean $ rt - mrtByperson[ factor (clean $ sub)] clean $ effect <- effect perDigRT_meanseffect <- tapply (clean $ effect, list (clean $ digit,clean $ sub),mean) mean_diag <- apply (perDigRT_meanseffect, 1 , mean) matplot (dig, perDigRT_meanseffect, type = "l" , lty = 1 , lwd = 1 , xlab = "Digits" , ylab = "Effect in Response Time (ms)" , col = "plum" ) 2
2 3 4 5 6 7 8 -100 -50 0 50 100 Digits Effect in Response Time (ms) 4. Compute the average effect for each digit, that is, average effects across people. Draw your plot from 3. and add a dark, black line for the average. mrtByperson <- tapply (clean $ rt,clean $ sub,mean) effect <- clean $ rt - mrtByperson[ factor (clean $ sub)] clean $ effect <- effect perDigRT_meanseffect <- tapply (clean $ effect, list (clean $ digit,clean $ sub),mean) mean_diag <- apply (perDigRT_meanseffect, 1 , mean) matplot (perDigRT_meanseffect, type = "l" , lty = 1 , lwd = 1 , xlab = "Digits" , ylab = "Effect in Response Time (ms)" , main = "Mean Response Time by Digits Acorss Participants" , col = "pink" ) lines (mean_diag, col = "black" , lwd = 3 ) 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1 2 3 4 5 6 -100 -50 0 50 100 Mean Response Time by Digits Acorss Participants Digits Effect in Response Time (ms) 5. So, we have a bit of a mystery. The plot with response times shows almost no effect compared to variability across people. It is consistent with propositional representation. The plot with effects shows a strong effect compared to variability across people. It is consistent with analog representation. We must reconcile this mystery. (a) Why do both these patterns simultaneously exist, and (b) What is your conclusion about representation (analog or propositional)? (c) Defend your conclusion. There is no code needed to answer this question; it is a matter of interpretation and adding value. The patterns appear differently since the response time and the effect are different. The effect shows the mean of the response time minus the subjects, while the response time is per digit, this is why there two different graphs. My conclusion is that the analog representation tells us more useful on this topic. I believe this since the analog gives us more information to work with since we are given the subjects and the average response time rather than only being given the response time alone. The extra information given from the analog representation allows us to see the results of this experiment more in-depth. 4