source('utils.R') # Section 6; Question 1: # source('chap_14_sect_6_question_1_data.R') res = number_of_runs_test( DF$Jan_Change ) print( sprintf( 'January Changes: w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) res = number_of_runs_test( DF$Year_Change ) print( sprintf( 'Annual Changes: w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) # Section 6; Question 2: # source('chap_14_sect_6_question_2_data.R') res = number_of_runs_test( DF$Boardings ) print( sprintf( 'w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) # Section 6; Question 3: # source('chap_14_sect_6_question_3_data.R') res = number_of_runs_test( DF$Network_Share ) print( sprintf( 'w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) # Section 6; Question 4; # source('chap_14_sect_6_question_4_data.R') res = number_of_runs_test( DF$Y_bar ) print( sprintf( 'w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) # Section 6; Question 5: # source('chap_14_sect_6_question_5_data.R') res = number_of_runs_test( DF$Number ) print( sprintf( 'w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) ) # Section 6; Question 6: # source('chap_14_sect_6_question_6_data.R') DF$Range = apply( DF[, c(2, 3, 4) ], 1, max ) - apply( DF[, c(2, 3, 4) ], 1, min ) res = number_of_runs_test( DF$Range ) print( sprintf( 'w= %d; z= %.3f; p_value= %.6f', res$w, res$z, res$p_value ) )