0

I have 2 linear regression models and I d like to see how many subjects responded correctly to the manipulation check question. Whats the best way to run it in R? Thanks

Alex
  • 9
  • 1
  • Your model (a linear regression), how you choose to fit that model (least squares probably), and the data you have collected (likely loaded into R and stored as a data.frame) are 3 different things. Your question is about your data, not your model or how you estimate the parameter(s) of that model. To answer your question about the data, you want something like: `sum(mydataframe$manipcheckquestion == correct_answer)`. This code effectively counts the number of times a variable (manipcheckquestion) in a data.frame (mydataframe) takes on a specific value (correct_answer). – DanY Jun 02 '20 at 20:24
  • Sorry, i wasnt specific enough. Actually id like to check how many subjects responded correctly based on their treatment group. So eg if they were assigned to T1, id like to check if their answer to manipulation check question is 1. If they were T2, answer to man check should be 2, etc. – Alex Jun 02 '20 at 20:42
  • This doesn't appear to be a specific programming question that's appropriate for Stack Overflow. If you seek recommendations for statistical models, then you should ask such questions over at [stats.se] instead. You are more likely to get better answers there. Otherwise include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jun 02 '20 at 21:46

0 Answers0