## load the required libraries.

Added on - 22 Sep 2019

  • 5

    Pages

  • 816

    Words

  • 121

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 2 of 5 pages
## load the required librarieslibrary(dplyr)library(magrittr)##import the dataset into R workspacet13 <- read.csv("TourismOperators2013.csv")t17 <- read.csv("TourismOperators2017.csv")#get the data typestr(t13)str(t17)#convert 'optimistic', 'ClimateChangeView' variables into categorical variablest13$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 datasetsummary(t13)summary(t17)## part Two##t13 %>%na.omit() %>%
group_by(Optimistic) %>%summarise(proportion = n()/nrow(t13)) -> t13.optimistict13.optimistict17 %>%na.omit() %>%group_by(Optimistic) %>%summarise(proportion = n()/nrow(t13)) -> t17.optimistict17.optimistic# Part (a)##(i)#conducting the one sample prop.testres= prop.test(x=5, n=10, p=0.7, alternative = "less", correct = F)#printing the resultsres#getting p-valueres$p.value#### (ii)
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document