lab3_exercises_new

docx

School

University of Southern California *

*We aren’t endorsed by this school

Course

511A

Subject

Statistics

Date

Apr 3, 2024

Type

docx

Pages

6

Uploaded by MegaElkPerson49

Report
Lab #3 Exercises (Part I) Students in a previous PM511a class filled out 2 questionnaires. Results are stored in four separate ASCII files located in the Lab Datasets folder in Canvas. The name of the files and their corresponding contents are summarized in Table 1. The data files are summarized in Tables 2 and 3. Your resulting data should resemble Table 4. Please provide all relevant code and output to receive full credit for the lab. Your Table 1: Name of the file and contents. Name of the file Contents lab1q1.dat Questionnaire #1 from Early Lab lab2q1.dat Questionnaire #1 from Late Lab lab1q2.dat Questionnaire #2 from Early Lab lab2q2.dat Questionnaire #2 from Late Lab Table 2: Data Description for lab1q1.dat and lab2q1.dat Variable Beginning column Description/Value ID 1 Four-digit ID Sex 6 M or F HtFeet 8 Height in feet (i.e. for 5’7” “5” is the value) HtInches 9 Height in inches (i.e. for 5’7” “7” is the value) Race 12 Race/Ethnicity 1 = Asian; 2 = Hispanic; 3 = White; 4 = Other BirthM 14 Birth Month BirthD 16 Birth Day LabNum 1 = Early Lab (11:00-1:00); 2 = Late Lab (3:00-5:00) Table 3: Data Description for lab1q2.dat and lab2q2.dat Variable Beginning column Description/Value ID 1 Four-digit ID Transportation 6 How to you come to school? 1 = Car; 2 = Walk; 3 = Public Transportation 4 = Bike GasPrice 8 How much per gallon of gas did you pay when you last filled up your car? SUV 13 Type of your car. 1 = SUV; 0 = Non-SUV CarMake 15 What make is your car? TankVol 26 How many gallons of gas can your gas tank hold? TankLast 29 How many miles can you drive on a whole tank of gas? City 33 Which city do you live? OneWay 50 How many miles from school to home (1 way?) SchTimes 56 How many times do you drive to school each week? LabNum 1 = Early Lab (11:00-1:00); 2 = Late Lab (3:00-5:00)
Table 4: Full data set
1. “Combine” (you decide to use merge or set ) these four ASCII files into one single SAS data file, ordered by sex. Your resulting file should be similar to the one on the next page. 2. Create a variable called HEIGHT that calculates each person’s height (in inches) based on HTFEET and HTINCHES. 3. Use regression analysis to fit the model TankVol = + *TankLast a. What is the resulting model? b. What is the mean tank volume for a car that can drive for 380 miles on a full tank of gas? (do not just plug in numbers, use the proc reg method). What are the 95% confidence limits on the true mean?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
c. Is TankLast a significant predictor for TankVol? (provide appropriate t- value and p-value) Lab #3 Exercises (Part II) In the following exercises, we will review regression and correlation concepts covered to date. We again work with the data from the Children’s Health Study (subjdata.sas7bdat), located in the Lab Datasets folder in the Course Resources section of Moodle. We focus the analysis on the pulmonary function test measure MMEF (maximum mid-expiratory flow rate). A. Analogy between t-test and regression 1) Use the appropriate procedure to test whether the mean MMEF differs between asthmatics and non-asthmatics. Fill in the table below Group Mean MMEF T-value p-value Asthmatics Non-asthmatics Conclusion? 2) Use regression analysis to fit the model MMEF = a + b*asthma. Recall that the asthma variable is coded as 0=nonasthmatic and 1=asthmatic. What is the resulting model? MMEF = * asthma What is the predicted mean MMEF for an asthmatic? What is the predicted mean MMEF for a nonasthmatic? Is asthma a significant predictor of MMEF? (Provide appropriate t-value and p- value) How do your results from question 2 compare to those from question 1?
B. Correlation, regression, and residuals 3) Use proc SGPLOT to graphically investigate the relationship between MMEF and Height. Does there appear to be a relationship? 4) Repeat your plot replacing height with htinches. How does the scatterplot change? 5) Calculate the correlation (using PROC CORR) between MMEF and height (in centimeters) and between MMEF and htinches. Use Pearson’s correlation coefficient, and report the corresponding p-value. Height R = p = Htinches R = p = Conclusion? 6) Regress MMEF on height (in centimeters) What is the resulting model? MMEF = + * height + E The mean height of these children is 140.6 centimeters (verify using proc means). What is the predicted mean MMEF for an average-height child? Is height a significant predictor of MMEF? (Provide appropriate t-value and p-value) Interpret R 2 from your regression of MMEF on height. How does this value relate to the correlation you computed in question 5?
7) Create a new variable in the data set called CENT_HT that is equal to height centered on its mean, i.e. CENT_HT = HEIGHT - 140.6. Re-run the regression of MMEF using CENT_HT instead of height. What is the resulting model? MMEF = + * cent_ht + E What is the interpretation of the intercept from this model? How do the t-value, p-value, and proportion of explained variance from this model compare to that from the height model? Evaluating assumptions and residual analysis. Re-run the regression of MMEF on height and output residuals to a SAS data set. Use your knowledge of the study design and analyses of the residuals to answer the following questions. Is our assumption of independence of the residuals valid? Why or why not? Can we assume the residuals are normally distributed? Why or why not? Is our assumption of linearity between MMEF and height valid? Why or why not? Is our assumption of homoscedasticity (equal variance) of the errors valid? Why or why not? 8) (optional) Try rerunning your regression analysis after applying a transformation to MMEF. Did your transformation help in satisfying the above assumptions?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help