df<-read.csv("df.csv")
names(df)
## [1] "num" "headcount" "composition" "Sex" "Age"
## [6] "Career" "Task" "Edu" "smoke" "disease"
## [11] "harm" "edu_imp" "edu_charge" "edu_time" "edu_need"
## [16] "test" "place" "clean_use" "clean_no" "clean"
## [21] "skill" "recruit" "system_need" "rule_1" "rule_2"
## [26] "rule_3" "rule_4" "rule_5" "tail_29_1" "tail_29_2"
## [31] "tail_29_3" "tail_29_4" "tail_29_5" "comply_1" "comply_2"
## [36] "comply_3" "comply_4" "comply_5" "tail_31_1" "tail_31_2"
## [41] "tail_31_3" "tail_31_4" "tail_31_5" "rule_effect" "sales"
## [46] "year_no_1" "year_no_2" "part_1" "part_2" "part_3"
## [51] "part_4"
df1<-df[,c(8,12)]
names(df1)
## [1] "Edu" "edu_imp"
df1$Edu<-as.factor(df1$Edu)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5 v purrr 0.3.4
## v tibble 3.1.2 v dplyr 1.0.6
## v tidyr 1.2.0 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## Warning: 패키지 'ggplot2'는 R 버전 4.1.3에서 작성되었습니다
## Warning: 패키지 'tidyr'는 R 버전 4.1.3에서 작성되었습니다
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
df2<-df1 %>% filter(Edu!="99")
g4.out1<-lm(edu_imp~Edu,data=df2)
anova(g4.out1)
## Analysis of Variance Table
##
## Response: edu_imp
## Df Sum Sq Mean Sq F value Pr(>F)
## Edu 3 0.700 0.23317 0.4466 0.7202
## Residuals 109 56.911 0.52212