Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This homework is designed to give you practice with calculating error bars (confidence intervals) with ddply and using ggplot2 graphics to produce insightful plots of

This homework is designed to give you practice with calculating error bars (confidence intervals) with ddply and using ggplot2 graphics to produce insightful plots of the results.

library(plyr) library(dplyr) library(ggplot2) 

You will continue using theadultdata set that you first encountered on Homework 3. This data set is loaded below.

adult.data <- read.csv("http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data", header=FALSE, fill=FALSE, strip.white=T, col.names=c("age", "type_employer", "fnlwgt", "education", "education_num","marital", "occupation", "relationship", "race","sex", "capital_gain", "capital_loss", "hr_per_week","country", "income")) adult.data <- mutate(adult.data, high.income = as.numeric(income == ">50K")) 

Problem 1: Calculating and plotting error bars for a 1-sample t-test

(a) Usingddplyand 1-sample t-testing, construct a table that shows the averagecapital_gainacrosseducation, along with the lower and upper endpoints of a 95% confidence interval. Your table should look something like:

 education mean lower upper 1 10th 404.5745 91.893307 717.2557 2 11th 215.0979 144.306937 285.8888 3 12th 284.0878 126.824531 441.3510 ... # Edit me 

(b) Reorder the levels of the factor in your summary table to correspond to ascending order of education. E.g., Preschool is the lowest, 1st-4th the next lowest, etc. You may find thefactor(..., levels = ...)command helpful here. For the post-high school grades, you can use the ordering: Assoc-voc, Assoc-acdm, Some-college, Bachelors, Masters, Prof-school, Doctorate.

# Edit me 

Need help with this assignment r studio Jupiter notebooks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elementary & Intermediate Algebra Functions And Authentic Applications

Authors: Jay Lehmann

2nd Edition

0321923456, 9780321923455

More Books

Students also viewed these Mathematics questions

Question

6.66 Find zo such that P(-zo

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

Self-confidence

Answered: 1 week ago

Question

The number of people commenting on the statement

Answered: 1 week ago