-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
34 lines (34 loc) · 1.95 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#Create multiple linear regression model
mechaCarModel <- lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance + AWD, data = MechaCar_mpg)
#generate summary statistics
summary(mechaCarModel)
#Create summary table
total_summary <- Suspension_Coil %>% summarize(Mean_PSI=mean(PSI),Median_PSI=median(PSI),Variance_PSI=var(PSI),SD_PSI=sd(PSI))
#Create summary table with multiple columns
lot_summary <- Suspension_Coil %>% group_by(Manufacturing_Lot) %>% summarize(Mean_PSI=mean(PSI),Median_PSI=median(PSI),Variance_PSI=var(PSI),SD_PSI=sd(PSI), .groups = 'keep')
library(tidyverse)
#Create multiple linear regression model
mechaCarModel <- lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance + AWD, data = MechaCar_mpg)
# Read in CSV file
MechaCar_mpg <- read.csv(file = 'springwedlund/Desktop/Data_Analytics /MechaCar_Statistical_Analysis/MechaCar_mpg.csv')
View(MechaCar_mpg)
View(mechaCarModel)
View(Suspension_Coil)
#Create multiple linear regression model
mechaCarModel <- lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance + AWD, data = MechaCar_mpg)
#generate summary statistics
summary(mechaCarModel)
#Create summary table
total_summary <- Suspension_Coil %>% summarize(Mean_PSI=mean(PSI),Median_PSI=median(PSI),Variance_PSI=var(PSI),SD_PSI=sd(PSI))
#Create summary table with multiple columns
lot_summary <- Suspension_Coil %>% group_by(Manufacturing_Lot) %>% summarize(Mean_PSI=mean(PSI),Median_PSI=median(PSI),Variance_PSI=var(PSI),SD_PSI=sd(PSI), .groups = 'keep')
#compare sample versus population means
t.test(Suspension_Coil$PSI, mu=1500)
t.test(subset(Suspension_Coil$PSI, Suspension_Coil$Manufacturing_Lot == 'Lot1'), mu=1500)
t.test(subset(Suspension_Coil$PSI, Suspension_Coil$Manufacturing_Lot == 'Lot2'), mu=1500)
t.test(subset(Suspension_Coil$PSI, Suspension_Coil$Manufacturing_Lot == 'Lot3'), mu=1500)
View(mechaCarModel)
View(mechaCarModel)
View(MechaCar_mpg)
View(Suspension_Coil)
View(total_summary)