Statistics Question

Advanced Psychological Statistics (Psych UA 11)Spring 2023
Data Assignment 1
For the following assignment, you will need to do analyses in R.
What you need to submit:
1. The code you used to complete your analyses
2. Your written response to each question
How should you write up the homework so we can grade it?
1. Some of you may have experience with RMarkdown (or maybe you want to learn how to use
RMarkdown!). If that’s the case, you can use RMarkdown to both run your code (in code
chunks) and write your responses (outside of those code chunks). Once you’re done, you
can knit (aka export) your RMarkdown file as a PDF and submit that.
2. The option most of you will probably use: If you’ve never heard of RMarkdown (or don’t
want to learn how to use it), it’s probably simpler to create run your analyses in R and then
write up the assignment in Microsoft Word, Google Docs, or whatever platform you use.
You can submit your code by either:
a. Taking screenshots of your code and pasting the images into your text document
b. Copying the code you used in R and directly pasting it into your text document
c. Submitting both a R Script file with your code + your text document
You will also need to paste the plots you created in R into your text document.
Whichever option you use, it is easiest for us to grade if you submit your write-up as a PDF.
Please help us save time grading by submitting it as a PDF (it opens directly in Brightspace as a PDF,
but Word documents don’t…). (R files are ok for your code!)
Do I need to write in full sentences? We aren’t going to grade you on your grammar, but when
asked to give your thoughts on something or to explain something in the data, please use full
sentences. You don’t have to write a lot, but full sentences make it clearer what you’re thinking.
How do I access R?
Here’s a guide on how to download R and RStudio onto your own computer.
You can also access R using NYU’s Virtual Lab or through a free account on RStudio Cloud (now
called posit cloud)—both great options, especially if you’re struggling to get R onto your computer!
I’m still confused on how to submit the homework, or I am having trouble with R! Please reach
out to your teaching assistant (they are all knowledgeable in how to use R!) or to me.
Question 1.
A researcher collects the ages of students of students in a graduate program to get a sense if how
old people are in the program. The ages are:
Participants
Participant Age
1
28
2
23
3
28
4
30
5
24
6
30
7
20
8
25
9
29
10
24
11
24
12
24
13
20
14
28
15
29
a. Create a data set in R using the above data (using data.frame() would help).
b. What is the mean? What is the median? What is the mode?
c. What can you say about the three measures of central tendency?
Question 2.
Create a random selection of 10 numbers ranging from 1 to 100 (using the sample() function with
replace set to TRUE). You’ll need to store this sample into an object (i.e., create a variable) so that
you can do calculations with the sample.
a. What is the median? What is the mean? Is there a difference between the two? Why?
b. Compute the standard deviation.
c. Create a plot to visualize these data.
Now create a random sample of 100 numbers ranging from 1 to 100 (again, using the sample()
function with replace set to TRUE).
a. What is the median, mean, and standard deviation of this sample?
b. Create a plot to visualize these data.
c. How do these values from your sample of 100 compare to your first sample of 10? Are they
similar/different? Why? [If you expected them to be similar and they are not (or vice versa),
why aren’t they similar (or different)?]
Question 3.
A researcher wants to study the impact of the presence (in the room) of a sweet snack on task
completion. 30 participants are given 5 logic problems to solve. Half of the participants are
randomly assigned to desks that have only a pencil and the word problems. The remaining
participants are assigned to desks with a pencil, the same word problems, and a candy dispenser.
Participants are timed and the completion times are recorded.
These are the times (in seconds)
Candy-Absent Group
Candy-Present Group
Participant
Reaction
Time
Participant
Reaction
Time
1
501
16
690
2
536
17
691
3
659
18
510
4
317
19
586
5
530
20
675
6
523
21
470
7
381
22
533
8
573
23
693
9
535
24
440
10
509
25
614
11
604
26
475
12
704
27
374
13
370
28
500
14
440
29
478
15
404
30
664
a. Compute the mean and median for both groups. What do you think about the results you’ve
computed?
b. If you changed the highest score in the Candy-Absent group to be 10 times the original
value, what would happen to the mean? What about median?
c. If you changed the highest score in the Candy-Present group to be one tenth is original
value, what would happen to the mean? What about the median?
Question 4.
A teacher developed a new studying technique and was interested in seeing if it worked. To test
this, they had students take a test before using the studying technique (to get a baseline score) and
then had students take a similar test one week later (after using the studying technique).
Here are their scores:
Participant
Pre-test
Post-test
1
4
6
2
5
6
3
6
5
4
7
8
5
4
8
6
7
5
7
5
6
8
9
9
9
6
4
10
8
8
11
2
5
12
8
7
13
3
2
a. Plot participants’ pre- and post-test scores in a single plot. What do you see? Does there
appear to be a relationship between their scores before and after using the studying
technique?
b. Now check to see if there is a correlation between participants’ pre- and post-test scores.
What is the correlation? You can use the cor() function in R.
c. What do you think of this teacher’s experiment to test their studying technique? Do you
think they did a good experiment to yield appropriate data to test the effectiveness of their
studying technique?
– If yes, why? Be concrete about what you think the teacher did right.
– If no, give one suggestion (besides running with a larger sample size) the teacher
could do to improve their experiment?

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Order your essay today and save 25% with the discount code: STUDYSAVE

Order a unique copy of this paper

600 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
Top Academic Writers Ready to Help
with Your Research Proposal

Order your essay today and save 25% with the discount code GREEN