Homework3

pdf

School

Montgomery College *

*We aren’t endorsed by this school

Course

101

Subject

Statistics

Date

Apr 3, 2024

Type

pdf

Pages

3

Uploaded by GrandSparrowMaster909

Report
Student Survey MA 2024-02-05 Set the working directory: 1. Download “StudentSurvey.csv” to your computer. 2. Set Working directory to the folder you saved your file in. 3. read the file using read.csv command. Instructions: Read the StudentSurvey into this markdown and answers the following questions #read the file my_data <- read.csv("StudentSurvey.csv") Check the data structure: #check the head of the data set head(my_data) ## Year Sex Smoke Award HigherSAT Exercise TV Height Weight Siblings ## 1 Senior M No Olympic Math 10 1 71 180 4 ## 2 Sophomore F Yes Academy Math 4 7 66 120 2 ## 3 FirstYear M No Nobel Math 14 5 72 208 2 ## 4 Junior M No Nobel Math 3 1 63 110 1 ## 5 Sophomore F No Nobel Verbal 3 3 65 150 1 ## 6 Sophomore F No Nobel Verbal 5 4 65 114 2 ## BirthOrder VerbalSAT MathSAT SAT GPA Pulse Piercings ## 1 4 540 670 1210 3.13 54 0 ## 2 2 520 630 1150 2.50 66 3 ## 3 1 550 560 1110 2.55 130 0 ## 4 1 490 630 1120 3.10 78 0 ## 5 1 720 450 1170 2.70 40 6 ## 6 2 600 550 1150 3.20 80 4 #check the dimensions dim(my_data) ## [1] 79 17
#create a table of students'sex and "HigherSAT" sex_High_sat<- table(my_data$Sex, my_data$HigherSAT) sex_High_sat ## ## Math Verbal ## F 25 15 ## M 24 15 # Display summary statistics for VerbalSAT Sat_summary <- summary(my_data$VerbalSAT) Sat_summary ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 420.0 550.0 580.0 583.2 630.0 720.0 #Find the average GPA of students abv_gpa<- mean(my_data$GPA, na.rm = TRUE) abv_gpa ## [1] 3.169114 #Create a new datafreame "column_df" that contains students' weight and number of hours the exer cise library (dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union column_df<- select(my_data, Weight, Exercise) head(column_df)
## Weight Exercise ## 1 180 10 ## 2 120 4 ## 3 208 14 ## 4 110 3 ## 5 150 3 ## 6 114 5 #access the fourth element in the first column element <-my_data [4,1 ] element ## [1] "Junior"
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help