-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
64 lines (64 loc) · 3.5 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
t.test(subset(sus_coil, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
# Deliverable 1
# Install dplyr packages
install.packages("dplyr")
# Read the CSV File
MechaCar_mpg <- read.csv("MechaCar_mpg.csv")
setwd("~/Documents/GitHub/R_Analysis/MechaCar_Statistical_Analysis")
MechaCar_mpg <- read.csv("MechaCar_mpg.csv")
View(MechaCar_mpg)
lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance + AWD,MechaCar_mpg) #generate multi linear regression
#Use the summary function to determine p-value and r-squared value
summary(lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance + AWD,MechaCar_mpg)) #summarize linear model
# Deliverable 2
# Read the Suspension coil file
sus_coil <- read.csv("Suspension_Coil.csv")
# Summarize measures of central tendancy
total_summary <- sus_coil %>% summarize(Mean=mean(PSI),Median=median(PSI),Variance=var(PSI),SD=sd(PSI)) # create total summary table with multiple columns
install.packages("dplyr")
total_summary <- sus_coil %>% summarize(Mean=mean(PSI),Median=median(PSI),Variance=var(PSI),SD=sd(PSI)) # create total summary table with multiple columns
t.test(subset(sus_coil, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
library(dplyr)
total_summary <- sus_coil %>% summarize(Mean=mean(PSI),Median=median(PSI),Variance=var(PSI),SD=sd(PSI)) # create total summary table with multiple columns
lot_summary <- sus_coil %>% group_by(Manufacturing_Lot) %>% summarize(Mean=mean(PSI),Median=median(PSI),Variance=var(PSI),SD=sd(PSI)) # create lot summary with group_by and summarize
t.test((sus_coil$PSI),mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
View(sus_coil)
View(sus_coil)
t.test((sus_coil$PSI),mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
t.test(subset(sus_coil, sus_coil[2] == "Lot 1")$PSI,mu=1500)
t.test(subset(sus_coil, sus_coil[2] == "Lot 1")[3],mu=1500)
test <- read.csv("Suspension_Coil.csv")
View(test)
test
suspension_data <- read.csv("Suspension_Coil.csv",stringsAsFactors = F, check.names = F)
t.test(subset(suspension_data, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
t.test(subset(suspension_data, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
suspension_data <- read.csv("Suspension_Coil.csv",stringsAsFactors = F, check.names = F)
t.test(subset(suspension_data, Manufacturing_Lot == "Lot 1")$PSI,mu=1500)
t.test((suspension_data$PSI),mu=1500)
colnames(suspension_data)
colnames(suspension_data)[1]
colnames(suspension_data)[2]
colnames(suspension_data)[3]
t.test(subset(suspension_data, colnames(suspension_data)[2] == "Lot 1")[3],mu=1500)
t.test(subset(suspension_data, colnames(suspension_data)[2] == "Lot 1"),colnames(suspension_data)[3],mu=1500)
View(total_summary)
colnames(suspension_data)[2] <- 'a'
colnames(suspension_data)[3] <- 'b'
suspension_data
t.test(subset(suspension_data, 'a' == "Lot 1")$b,mu=1500)
subset(suspension_data, suspension_data$a == "Lot 1")
subset(suspension_data, 'a' == "Lot 1")
subset(suspension_data, 'a' == "Lot1")
subset(suspension_data, 'a' == "Lot2")
suspension_data <- read.csv("Suspension_Coil.csv",stringsAsFactors = F, check.names = F)
suspension_data
subset(suspension_data, 'Manufacturing_Lot' == "Lot2")
subset(suspension_data, Manufacturing_Lot == "Lot2")
t.test(subset(suspension_data, Manufacturing_Lot == "Lot2")$PSI,mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot21")$PSI,mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot1")$PSI,mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot2")$PSI,mu=1500)
t.test(subset(sus_coil, Manufacturing_Lot == "Lot3")$PSI,mu=1500)