% MATLAB Tutorial - Nuclear Science and Engineering - Spring 2008 % Instructor: Violeta Ivanova, violeta@mit.edu % Faculty: Jacquelyn Yanch, jcyanch@mit.edu % EXERCISE 2 Correlation and Hypothesis Testing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A. DATA IMPORT % Import data on cigarette smoking and cancer mortality rates % per state from file CANCERSMOKING.dat. % CIG: Cigarettes [hundreds per capita] % Cancer deaths [per 100K population]: % BLAD: Bladder; LUNG: lung; KID: kidney; LEUK: Leukemia. % Hint: Use Create Vectors from Columns in the Import Wizard. % Type WHO to confirm the vectors are created. who %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % B. PLOTTING % Plot the four cancer type mortality ratesand analyze in the Figure editor. % Hint: use markers with different colors (plot with no lines). plot (CIG, BLAD, 'ro'); hold on plot (CIG, LUNG, 'ko'); hold on plot (CIG, KID, 'bo'); hold on plot (CIG, LEUK, 'go'); hold off %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % C. CORRELATION COEFFICIENT % Compute correlation coefficients between mortality rates and cigarette % smoking and between the different cancers. % Which correlations are significant within 95% confidence interval? % Hint: Combine the data in a matrix first. DATA = [CIG LUNG BLAD KID LEUK]; [R, P] = corrcoef(DATA); [i, j] = find(P<0.05); [i j] R P