Question

In: Statistics and Probability

R work (must be done in R) Before opening the dataset needed for this problem, you’ll...

R work (must be done in R)

Before opening the dataset needed for this problem, you’ll need to call the “car” package. Run the following line of code:

> library(car)

 Now you can import the “ Cowles” dataset and use it to answer the question below.

Name the data frame with your EID:

> my_eid <- Cowles

Remember to include any code you use along with your answers in your submission!

3. Cowles and Davis (1987) collected data on the personality traits of individuals who volunteered (and didn’t volunteer) for psychological research. The researchers used Eysenck’s personality inventory to measure each participant’s neuroticism and extraversion score (on a scale of 0-24, with higher scores indicating more neurotic/ extraverted).

a. Create a graph to compare the distributions of extraversion scores between those who did and did not volunteer for psychological research.

b. Calculate the means and standard deviations of extraversion scores for each group of participants (split by volunteer status).

c. Carry out the appropriate test to determine if average extraversion score differs based on volunteer status. Include all steps for full credit.

Solutions

Expert Solution

Please see the R code below

library(car)
library(dplyr)

data("Cowles")
Cowles


# a

par(mfrow=c(1,2))

hist(Cowles$extraversion[Cowles$volunteer=="yes"],col="skyblue",main= "Volunteer")
hist(Cowles$extraversion[Cowles$volunteer=="no"],col="purple",main= "No Volunteer")


# b

Cowles %>% group_by(volunteer) %>% summarise(Average = mean(extraversion),SD = sd(extraversion))


# c) perform a t test

t.test(Cowles$extraversion[Cowles$volunteer=="yes"],Cowles$extraversion[Cowles$volunteer=="no"])

The results are

Cowles %>% group_by(volunteer) %>% summarise(Average = mean(extraversion),SD = sd(extraversion))
# A tibble: 2 x 3
volunteer Average SD
<fct> <dbl> <dbl>
1 no 12.0 3.83
2 yes 12.9 3.91

t.test(Cowles$extraversion[Cowles$volunteer=="yes"],Cowles$extraversion[Cowles$volunteer=="no"])

Welch Two Sample t-test

data: Cowles$extraversion[Cowles$volunteer == "yes"] and Cowles$extraversion[Cowles$volunteer == "no"]

t = 4.6907, df = 1270.1, p-value = 3.018e-06 # as the p value is less than 0.05 , hence the results are statisitcally significant for the model

alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:

0.5685632 1.3860765

sample estimates:

mean of x mean of y

12.93970 11.96238


Related Solutions

Before opening the dataset needed for this problem, you’ll need to call the “car” package: >...
Before opening the dataset needed for this problem, you’ll need to call the “car” package: > library(car) Now you can import the “Wong” dataset and use it to answer the question below. Remember to include any code you use along with your answers in your submission! 3. The Wong dataset contains data from a study by Wong, Monette, and Weiner (2001) on patients who fell into comas after sustaining traumatic brain injuries. After waking, Wong and colleagues administered two different...
Use RStudio to answer this question. Before opening the dataset needed for this problem, you’ll need...
Use RStudio to answer this question. Before opening the dataset needed for this problem, you’ll need to call the “car” package > library(car) Now you can import the “Robey” dataset and use it to answer the question below. Name the data frame with abc: > abc <- Robey Remember to include any R code you use along with your answers! The Robey dataset contains fertility rates from a sample of countries. You want to see if total fertility rate (tfr),...
To find the dataset needed for this problem, you’ll first need to open the “swiss” dataset...
To find the dataset needed for this problem, you’ll first need to open the “swiss” dataset that is contained in R by running the following line: > data('swiss') Now you can rename the “swiss” dataset and use it to answer the question below. Name the data frame with your UT EID:                         > my_variable <- swiss This dataset contains socio-economic indicators for the French-speaking provinces of Switzerland in the year 1888. Among the variables, “Agriculture” is the percentage of the...
All work must be done in R programing. Consider this dataset provided to you as prob10.txt...
All work must be done in R programing. Consider this dataset provided to you as prob10.txt c1 t1 c2 t2 c3 t3 c4 t4 2650 3115 2619 2933 2331 2799 2750 3200 1200 1101 1200 1309 1888 1901 1315 980 1541 1358 1401 1499 1256 1238 1625 1421 1545 1910 1652 2028 1449 1901 1399 2002 1956 2999 2066 2880 1777 2898 1999 2798 1599 2710 1754 2765 1434 2689 1702 2402 2430 2589 2789 2899 2332 2300 2250 2741...
Part 2– R work (must be done in R) Copy and paste your R code and...
Part 2– R work (must be done in R) Copy and paste your R code and output into a word document, along with your written answers to the questions, and upload to Canvas.   Follow these instructions to import the necessary dataset: Before opening the dataset needed for this problem, you’ll need to call the “car”package.  Run the following line of code: > library(car) Now you can import the “Prestige” dataset and use it to answer the question below. Name the data...
R Problem Set: #Work with the inbuilt dataset "Cars" View(cars) This will show you the dataset...
R Problem Set: #Work with the inbuilt dataset "Cars" View(cars) This will show you the dataset on 2 variables speed and distance. ?cars This will explain what the variables mean. #Q1) Describe the dataset. What are the main findings? #Q2) Design a relevant question to model using linear regressions #Q3) Run the regression and report the std error, t-stat, p value and f stat. #Q4) Is this a valid regression? Is the normality assumption justified? Show clearly. #Q5) Are there...
***This problem must be done using R so please provide the R code used to find...
***This problem must be done using R so please provide the R code used to find the solution. I have provided the data in data-wtLoss.txt below the question. I will also give "thumbs-up for correct R code" Thanks in advance.*** The file “data-wtLoss.txt” contains data on weight loss and self esteem evaluation at three time points over a period of three months for 34 individuals who are randomly selected from a residential area. These individuals are randomly assigned to one...
***This problem must be done using R so please provide the R code used to find...
***This problem must be done using R so please provide the R code used to find the solution. I have provided the data in data-wtLoss.txt below the question. I will also give "thumbs-up for correct R code" Thanks in advance.*** The file “data-wtLoss.txt” contains data on weight loss and self esteem evaluation at three time points over a period of three months for 34 individuals who are randomly selected from a residential area. These individuals are randomly assigned to one...
I have an assignment that must be done on R/R studio R/RStudio - Chapter 4- Correlation...
I have an assignment that must be done on R/R studio R/RStudio - Chapter 4- Correlation and Regression Step 1 – Download and Install the R/RStudio software on your computer. The link and instructions to do that are on Blackboard under Course Information. Step 2 – Access the Data Sets in MyLab through StatCrunch. In chapter 4, a data set called “Used BMW prices 2017” is what we’ll use. Step 3 – When you open the data set in StatCrunch,...
please do this in C++! I want to understand it, it must be done before the...
please do this in C++! I want to understand it, it must be done before the evening or nightime. Follow instructions exactly as it says. Please send a screenshot also with your code so I can see how it is supposed to be formatted. Since typing it a chegg answer, makes it look a bit messy. Your program will read in a file of commands. There are three types of commands: Warrior creates a new warrior with the specified name...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT