N number of observations mean sample mean var sample

This preview shows page 2 - 5 out of 11 pages.

n number of observations mean sample mean var sample variance by plant group the data according to the plant from which the observation was selected var discharge generate mean and variance of the variable dischrg (for each plant) */ proc means n mean var; by plant; var dischrg; /* Create new temporary SAS dataset which only contains the observations from Plant B */ data onlyB; /* Use set command to bring in all the data */ set lab4w18; 2
Image of page 2

Subscribe to view the full document.

/* Use if statement to restrict the data to Plant B, i.e., Plant 2*/ if plant = 2; /* Could also use: if name = ’Plant B’; */ /* **************************************************** */ /* **************************************************** */ /* NEW CODE BEGINS HERE */ /* Create new variable representing the transformed data new_data = (original variable) - (mean value to test) */ new_data = dischrg - 1.75; /* Use proc means to generate information for testing mean of new_data = 0 n number of observations mean sample mean t t-test statistic probt p-value for two-sided test */ proc means n mean t probt; var new_data; /* END OF NEW CODE */ /* *************************************************** */ /* *************************************************** */ proc print noobs; proc means n mean var stddev; var dischrg; /* Create new SAS dataset which only contains the observations from Plants A and B */ data bothAB; /* Use set command to bring in all the data */ set lab4w18; /* Use if statement to restrict the data to Plants A and B, i.e., Plants 1 and 2 */ if plant = 1 or plant = 2; /* Could also use: if name = ’Plant A’ or name = ’Plant B’; */ proc print; /* Use proc means to generate some descriptive statistics. Use the by statement to generate statistics for each plant. */ proc means n mean stddev; by plant; var dischrg; run; quit; Reminder: Save your SAS file as lab5w18s. Execute the program and complete the following: 3
Image of page 3
The MEANS Procedure Analysis Variable : new_data N Mean t Value Pr > |t| ----------------------------------------------- _____ _________ ________ ________ ----------------------------------------------- ♠ H 0 : µ B = 1.75 ♠ H a : µ B 6= 1.75 ♠ The p-value is . ♠ RR: Reject H 0 if p-value < α = 0.05 ♠ What is your conclusion? (Be sure to justify your answer!) Conclusion: Since the p-value = is (less than, greater than) [circle your choice] α = 0.05, (reject,do not reject) [circle your choice] H 0 → it (is, is not) [circle your choice] reasonable to assume the true mean discharge effluent for Plant B is significantly different from 1.75 pounds/gallon. (ii) One can also use proc univariate:We need to include a value of µ 0 to test in the proc univariate statement.We can do this using mu0 as follows: /* Use proc univariate to test mu0 value Use ods select TestsForLocation to suppress printing of all output except the tests for location */ proc univariate mu0 = 1.75; ods select TestsForLocation; var dischrg; Add the above lines of code, right after the following block of code proc means n mean t probt; var new_data; in your program. Save and execute your program. Complete the following: Tests for Location: Mu0=1.75 Test -Statistic- -----p Value------ Student’s t t _________ Pr > |t| __________ (iii) Using SAS, generate a 99% confidence interval for the true mean discharge for Plant B (i.e.,plant 2). We can do this using proc means as follows: 4
Image of page 4

Subscribe to view the full document.

/* Use proc means to generate confidence interval Specify value of alpha to use: 99% -> alpha = 0.01 */ proc means n mean stddev clm alpha = 0.01; var dischrg; Add the above lines of code, right after the following block of code: proc univariate mu0 = 1.75; ods select TestsForLocation; var dischrg;
Image of page 5
You've reached the end of this preview.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern