Chat with us, powered by LiveChat R question - Essayabode

R question

I'm working on a r question and need an explanation and answer to help me learn.

#INSTRUCTIONS

#Type the codes for each question

#Include answers to ALL questions in the script as a comment (with a #).

#Questions with a * next to it will ALSO require you to input the answer in Canvas.

#Lastly, upload this R script AND input the corresponding answers to Canvas.

#If you are missing codes or answers in this script, points will be deducted.

#Download and call each package from library

install.packages("openintro")

install.packages("dplyr")

install.packages("ggplot2")

library(openintro)

library(dplyr)

library(ggplot2)

#Run data and view the name of variables

data(acs12)

names(acs12)

#The data is named "acs12"

View(acs12)

###CONFIDENCE INTERVALS

###EXAMPLE, solve the problems using this guideline###

#1. Construct a 95% CI for the average commute time for Americans (the variable we're looking at is caled "time_to_work")

#What is the interval for the average commute time? What does this mean?

#The average commute time is 24.4, 27.6 minutes. This means that we can be 95% confident that the average commute time is between these values.

t.test(acs12$time_to_work)

#*2. Construct a 95% CI for the average income and explain your results. The variable is called "income"

#*3. Construct a 95% CI for the average hours worked and explain your results. This variable is called "hrs_work"

#*4. Construct a 95% CI for the average age and explain your results. This variable is called "age"

### T-Tests HYPOTHESIS TESTS

###REMEMBER we REJECT the Ho if the p-value is LESS than alpha of 0.05

###EXAMPLE BELOW, solve the problems using this question

#5. Assume the average commute time of Americans is thought to be 26 min.

#Write the null hypothesis and the conclusion

#***This is a two-sided test, meaning we are not looking at greater or less than

#Ho: average commute = 26

#Ha: average commute NOT equal to 26

t.test(acs12$time_to_work, mu=26, alternative = "two.sided")

#The p-value is 1 which is GREATER than alpha of 0.05. Therefore we FAIL TO REJECT the HO. The average commute is equal to 26

# *6. Assume that the average age is thought to be GREATER than 30.

#Write the null hypothesis and the conclusion

#*** This is a one-sided test, we are looking at GREATER than 30 as the alternative

#Ho:

#Ha:

# P-value and conclusion:

# *7. Assume that the average age is thought to be LESS than 50.

#Write the null hypothesis and the conclusion

#*** This is a one-sided test, we are looking at LESS than 50 as the alternative

#Ho:

#Ha:

# P-value and conclusion:

# *8. Assume that the average age is thought to be EQUAL TO 30.

#Write the null hypothesis and the conclusion

#*** This is a two-sided test, we are looking at "two.sided" as the alternative

#Ho:

#Ha:

# P-value and conclusion:

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?