Analysis of Tourism Operators' Optimism and Climate Change Views in 2013 and 2017
5 Pages816 Words329 Views
Added on 2019-09-22
About This Document
This analysis compares the optimism and climate change views of tourism operators in 2013 and 2017 using prop.test and t-test. The dataset includes categorical variables such as optimistic and climate change views. The first part of the analysis involves the summary of the dataset, converting variables into categorical variables, and conducting one sample prop.test. The second part of the analysis involves conducting two proportion z-test and comparing the means with t-test.
Analysis of Tourism Operators' Optimism and Climate Change Views in 2013 and 2017
Added on 2019-09-22
BookmarkShareRelated Documents
## load the required libraries library(dplyr) library(magrittr) ##import the dataset into R workspace t13 <- read.csv("TourismOperators2013.csv") t17 <- read.csv("TourismOperators2017.csv") #get the data type str(t13) str(t17) #convert 'optimistic', 'ClimateChangeView' variables into categorical variables t13$Optimistic <- as.factor(t13$Optimistic) t13$ClimateChangeView <- as.factor(t13$ClimateChangeView) t17$Optimistic <- as.factor(t17$Optimistic) t17$ClimateChangeView <- as.factor(t17$ClimateChangeView) ##summary of the dataset summary(t13) summary(t17) ## part Two ## t13 %>% na.omit() %>%
group_by(Optimistic) %>% summarise( proportion = n()/nrow(t13) ) -> t13.optimistic t13.optimistic t17 %>% na.omit() %>% group_by(Optimistic) %>% summarise( proportion = n()/nrow(t13) ) -> t17.optimistic t17.optimistic # Part (a) ##(i)#conducting the one sample prop.test res= prop.test(x=5, n=10, p=0.7, alternative = "less", correct = F)#printing the results res#getting p-value res$p.value #### (ii)
End of preview
Want to access all the pages? Upload your documents or become a member.