ADV BIOSTATS METHODS IN PUBLIC HEALTH
ADV BIOSTATS METHODS IN PUBLIC HEALTH CPH 930
Popular in Course
Popular in Health and Public Affairs
This 33 page Class Notes was uploaded by Mathew Casper on Friday October 23, 2015. The Class Notes belongs to CPH 930 at University of Kentucky taught by Staff in Fall. Since its upload, it has received 15 views. For similar materials see /class/228220/cph-930-university-of-kentucky in Health and Public Affairs at University of Kentucky.
Reviews for ADV BIOSTATS METHODS IN PUBLIC HEALTH
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/23/15
CPH 930 Fall 2006 Dr Charnigo Computing Introduction This document7 available from my web page as either SASQ30F06ps or SASQ30FOGpdf7 will be updated as the semester pro gresses I will primarily focus on those aspects of SAS required to carry out the analyses described in the lectures or necessary for completion of your written assignments Viewing postscript les Apart from text les containing SAS code and Ex cel les containing data sets7 most CPH 930 course materials will be made available as both post script PS and portable display format PDF les If you do not have a PS viewer and wish to obtain one for free7 you can go to httpwwwcswiscedu ghostdocAFPLget814htm Download the two EXE les under Windows 957 987 ME7 NT7 2000 or XP 7 and follow the instructions that you are given SAS warmup descriptive statistics Before we attempt to t a linear regression model7 let us carry out some simple exploratory data analysis tasks to acquaint ourselves with how SAS accepts input and furnishes output Please refer to SASDescriptivetxt7 a text le in which I provide the SAS code that produced the numerical and graphical output in TABLE213pdf I will describe each segment of code below You will notice that7 in this doc ument but not in the text le7 l italicize certain parts of the code These are parts of the code that you will have to modify when you want to obtain analogous output for other data sets If you like7 you can rst try running the code unmodi ed for practice except that you will have to replace CD0cuments and Settingsm39chcMy Documents STA503F05 material by the name of an appropriate path Note that you can copy and paste ma terial from a text le into SAS by highlighting the material in the text le With the mouse pressing Ctrl C on the keyboard going to the Editor box in SAS and then pressing Ctrl V In SAS choosing Run and then Submit at the top of the screen will execute Whatever code is in the Editor box if you want only a portion of the code executed7 highlight that portion With the mouse before choosing Run and Submit PROC IMPORT DATAFILE CDocuments and Settings richcMy Doc uments STA503F05 materialTABLE213ixls OUT Serum DBMS EXCEL REPLACE SHEET Sheet GETNAMES YES RUN The segment of code above reads data from the Excel le TABLE213xls into SAS In general you will need to change CD0cuments and Settingsm39chcMy Documents STA503F05 material to the name of an appropriate path change TABLEQIBals to the name of the Excel le from which you want to read data change Semm to Whatever you want to call the data inside SAS and change Sheet to the name of the sheet in the Excel le containing the data Make sure that the Excel le is closed before you execute such code in SAS PROC PRINT data Serum RUN The segment above asks SAS to print the data just imported Although an error message in the Log box will alert you if the attempt to read data has failed issuing a PROC PRINT allows you to see Whether SAS has changed any of the variable names SAS will sometimes change variable names if they contain unusual characters ODS PDF FILE CDocuments and Settings richcMy Documents STA503F05 moteriolTABLE213ipdf The line above invokes the Output Display System telling SAS that the numerical and graphical output produced by subsequent commands is to be saved to a PDF le in the indicated path If you Wish to produce an RTF document that can be opened in Microsoft Word instead of a PDF document7 replace all instances of PDF by RTF title Semm cholesterol changes PROC UNIVARIATE data Serum plots var Dz erence Histogram c ll yWh midpoints 20 to 50 by 10 RUN title Semm cholesterol changes PROC BOXPLOT data Serum plot Di erenceSample boxstyle schematic nohlabel cframe vligb cboxes dagr cbox ll ywh RUN The title commands tell SAS how to label the graphical output The rst segment of code produces the output on pages 1 through 3 of TABLE213pdf In general7 change Serum to the name of the data set inside SAS change Dif ference to the name of the variable in which you are interested and7 change midpoints 20 to 50 by 10 to identify your desired bin Widths for the his togram or remove this altogether to accept SAS defaults The boxplot on page 2 of TABLE213pdf is pretty revolting the second segment of code produces the more attractive boxplot on page 4 of TABLE213pdf Since PROC BOXPLOT is designed to produce side by side boxplots for differ ent groups7 you have to trick SAS into producing a single boxplot You can do this by de ning a variable called Sample in the Excel spreadsheet7 assigning the value Sample to all subjects7 and then using SAS code like that above title Semm cholesterol changes by gender PROC UNIVARIATE data Serum plots by Gender var Dl erence Histogram c ll ywh mldpolnts 20 to 50 by 10 RUN title Semm cholesterol changes by gender PROC BOXPLOT data Serum plot Dl erence Gender boxstyle schematic cframe vligb cboxes dagr cbox ll ywh RUN The segments of code above allow us to look at the two genders separately In general7 change Gender to the name of the variable de ning different groups that you want to look at Note that the data must be sorted by this variable Hence7 if the rst twelve subjects had been male which be gins with m and the last twelve female which begins with f 7 I could have sorted the data in Excel prior to reading the data into SAS The re sults of running the segments above are found on pages 5 through 12 of TABLEZdef ons PDF CLOSE RUN These two lines tell SAS that you no longer want output written to a PDF le Linear regression Please refer to SASregressionltxt which contains four segments of code The rst segment of code7 printed below reviews how to read in data from an Excel le The parts in italics are what you need to modify Re place USTA503uno clol Cholesterolxls by your lename and CholSAS by whatever you want to call your data set inside SAS In addition re place Cholesterol by the name of the sheet in the Excel le that contains the data Make sure that the Excel le is closed before you execute the code PROC IMPORT DATAFILE USTA503uno clol Cholesterolxls OUT CholSAS DBMS EXCEL REPLACE SHEET Cholesterol GETNAMES YES RUN The second segment of code allows you to verify that you have successfully read in your data Just replace CholSAS by whatever you decided to call your data set inside SAS If the variable names in Excel have characters that cannot be used in SAS variable names SAS will change these characters to underscores you will want to note if this happens as you will need to refer to variables by their SAS names in what follows PROC PRINT DATA CholSAS RUN The third segment of code ts a linear regression model presuming that you have already decided upon explanatory variables and that you want diag nostic output Variable selection will be discussed in Lecture 2 Diagnostic output will be discussed in Lecture 3 Change CholSAS to Whatever you decided to call your data set inside SAS Change TC to the name of the response variable Replace POLYFAT ALCOHOL BM by the names of the explanatory variables Replace 0 05 With the value of oz for which you desire 1001 00 con dence intervals for mean responses and 1001 00 pre diction intervals In the PLOT statements7 replace POLYFAT ALCOHOL and BM With the names of your explanatory variables If you have more than three explanatory variables7 you will need to add more PLOT statements you want two PLOT statements for each explana tory variable one involving STUDENT and one involving RSTUDENT For your information VIF and CORRB request output that may help you to diagnose collinearity INFLUENCE requests output that may help you to identify unduly in uential observations clm and cli request con dence in tervals for mean responses and prediction intervals partial and the PLOT statements request diagnostic plots that have various purposes P stands for predicted value STUDENT stands for internally studentized residual and RSTUDENT stands for externally studentized residual PROC REG DATA CholSAS MODEL TC POLYFAT ALCOHOL BMI VIF CORRB INFLUENCE partial clm cli ALPHA 0 05 PLOT STUDENT P PLOT STUDENT POLYFAT PLOT STUDENT ALCOHOL PLOT STUDENT RMI PLOT RSTUDENT P PLOT RSTUDENT POLYFAT PLOT RSTUDENT ALCOHOL PLOT RSTUDENT RMI PLOT nqq STUDENT RUN The fourth segment of code shows how to perform a partial f test For conve nience l have omitted the commands for most of the diagnostic output Re place ENERGY TOTFAT SATFAT VEGFAT ANIMFAT CHOL FIBER following the test statement With the names of the explanatory variables for Which you want to test the null hypothesis that all of the corresponding partial slope coef cients equal zero PROO REG DATA CholSAS MODEL To ENERGY TOTFAT SATFAT POLYFAT VEGFAT ANIM FAT OHOL FIBER ALCOHOL BMI VIF OORRB test ENERG Y TOTFAT SATFAT VEGFAT ANIMFAT CHOL FIBER 7 RUN More linear regression quadratic terms and categorical predictors Please refer to SASregression2txt First I read in the data set Of course7 you would replace CDocuments and Settings richcMy Documents CPH930F06BWeightdxls by your path and le name7 B by whatever you wanted to call your data set inside SAS7 and B Weight by the name of the sheet containing the data in the Excel le Make sure that the Excel le is closed before executing the code PROC IMPORT DATAFILE CDocuments and Settings richcMy Documents CPH930F06B Weight xls OUT B DBMS EXCEL REPLACE SHEET B Weight GETNAMES YES RUN I then asked SAS to print the data set for me Again7 you would change B to the name of your data set inside SAS PROC PRINT DATA B RUN Next I modi ed the data set The SET line told SAS which data set I was modifying7 and the DATA line told SAS what name I wanted to give to the modi ed data set The commands gestQ ges gest and gestf gestgestgest told SAS to create new variables for the square and cube of gestational age The commands mildpre 07 modpre 07 and sevpre 0 told SAS to create new variables that would serve as indicators for mild prematurity7 moderate prematurity7 and severe prematurity Each new variable was ini tially equal to O for all infants The command if premcat 1 then mildpre I told SAS that the mild prematurity variable would equal 1 for infants in prematurity category 1 The command if premcat 2 then modpre J told SAS that the moderate prematurity variable would equal 1 for infants in prematurity category 2 The command if premcat 3 then sevpre J told SAS that the severe prematurity variable would equal 1 for infants in prematurity category 3 DATA BNEW SET B gestQ gestgest gestf gestgestgest mildpre 0 modpre 0 sevpre 0 if premcat 1 then mildpre J if premcat 2 then modpre J if premcat 3 then sevpre J RUN I then asked SAS to print out the modi ed data set and to begin writing output to a PDF le commands not reprinted here Next I t a linear regression model with birthweight as the response variable and gestational age as the sole explanatory variable I also requested a scatterplot of birthweight against gestational age Since this analysis and the subsequent ones were intended to illustrate very speci c points7 I did not request detailed diagnostic output 10 PROO REG DATA BNEW MODEL BWT gest PLOT BWTgest RUN I proceeded to t linear regression models with a quadratic term and a cubic term in gestational age PROO REG DATA BNEW MODEL BWT gest gestQ PLOT BWTgest RUN PROO REG DATA BNEW MODEL BWT gest gestQ gestf PLOT BWTgest RUN The next model I t had birthweight as the response variable and the three indicators as explanatory variables Let Y denote birthweight and P1 P2 P3 denote the three indicators This model had the form Yz39 04 51P1 52PM 53PM 6239 A test of whether 51 0 would address whether mean birthweight differed between mildly premature infants and those who were not premature But what if we wanted to determine whether say mean birthweight differed be tween mildly premature infants and moderately premature infants Then we would need to test whether 51 g ie7 whether 51 g O I carried 11 out this test With the command test mildpre modpre PROC REG DATA BNEW MODEL BWT mildpre modpre sevpre test mildpre modpre RUN Finally7 I ran a one way analysis of variance With birthweight as the response variable and prematurity category as the single factor I did this to provide an empirical con rmation of the equivalence between regression With indi cators and one way analysis of variance proc glm data BNEW class Premcat model BWT Premcat ss3 run Even more linear regression variable selection Please refer to SASregression3txt The rst piece of code is identical to that of SASregressionltxt and just reads in the data set PROC IMPORT DATAFILE USTA503un0 cial Cholesterol xls OUT CholSAS DBMS EXCEL REPLACE SHEET Cholesterol GETNAMES YES RUN After telling SAS to save the output to a PDF le commands not reprinted here7 I asked SAS to carry out forward selection In place of ChOZSAS you will have the SAS name of your data set Change TO to the name of your response variable7 and change ENERGY TOTFAT SATFAT POLY FAT VEGFAT ANIMFAT CHOL FIBER ALCOHOL BM to a list of your candidate explanatory variables Finally7 change each 05 to re ect the sig ni cance level that you want to impose in forward selection PROC REG DATA CholSAS MODEL TC ENERGY TOTFAT SATFAT POLYFAT YEGFAT ANI MFAT CHOL FIBER ALCOHOL BMI SELECTIONforward SLE05 SLS05 RUN Asking SAS to carry out backward elimination or stepwise selection is the same except for one word PROC REG DATA CholSAS MODEL TC ENERGY TOTFAT SATFAT FOLYFAT VEGFAT ANIM FAT CHOL FIBER ALCOHOL BMI SELECTIONbackward SLE05 SLS05 RUN PROC REG DATA CholSAS MODEL TC ENERGY TOTFAT SATFAT FOLYFAT YEGFAT ANI MFAT CHOL FIBER ALCOHOL BMI SELECTIONstepwise SLE05 SLS05 RUN You already saw in SASregressiontht how to create a new variable that is the square of an existing variable Now suppose that you want to create a new variable that is the logarithm or the square root of an existing variable The code below illustrates how to do this data CholSASenhanced set CholSAS logTC l0gTC sqrtTC sqrtTC run Receiver operator curves Refer to SASROCtxt The rst segment of code is shown below Refer to the matrix of numbers after the cards line Put the sensitivities in the rst column In the second column you need to carry over the contents from the rst column but drop the numbers down one spot Put the speci cities in the third column In the fourth column you need to carry over the contents from the third column but drop the numbers down one spot data SensSpec input Sens LagSens Spec LagSpec OneMinusSpec 1 Spec Contr 05SensLagSensSpec LagSpec label Sens Sensitivity label OneMinusSpec 1 minus Speci city cards 10 1 0 0 0 0 0 94 1 0 57 0 0 90 94 67 57 86 90 78 67 65 86 97 78 0 0 65 1 0 97 run Shown next is the second segment of cocle7 which does not require modi cation This calculates the area under the receiver operator curve proc means clataSensSpec sum var Contr run Here is the nal segment of code except for the Output Display System commands This produces the receiver operator curve title Receiver operator curve symboll cBLUE ciBLUE vSQUARE height1 cells interpolJOlN l1 W1 proc gplot clataSensSpec plot Sens OneMinusSpec run Measures of effect Refer to SASrneasurestxt Suppose for now that there is no confounder The rst piece of code is shown below Change the numbers 33 1667 27 2273 to the values a b c d with which you are dealing where a b c d are as displayed in Table 131 my example is based on Table 133 data Measures input Exposure Response Count datalines O O 33 O 1 1667 1 0 2 7 1 1 2273 7 The second piece of code produces output like that shown in Lungcancerpdf All you need to do is change the title proc freq dataMeasures weight count tables exposureresponse relrisk riskdiff title Lung Cancer versus Heavy Drinking run Now suppose that there is a confounder The piece of code shown below enters in the data Change the numbers 24 7 76 6 194 and 9 89 2 2079 to the values of a b c d for the rst straturn and the values of a b c d for the second straturn data Measures2 input Confounder Exposure Response Count datalines O O O 24 O O 1 776 O 1 O 6 O 1 1 194 1 O O 9 1 O 1 89 1 1 O 21 1 1 1 2079 7 If there had been a third straturn7 you could have added four more rows before the nal semicolon 200a 201b 210c 211d This pattern could be continued for as many strata as you had 300a 301b 310c 311d 400a 401b 410C 411d Once the data have been entered7 the following commands will provide fre quency tables for the different strata7 the outcome of the Mantel Haenszel test7 an interval estimate of an odds ratio common to all strata7 and the outcome of a test for effect modi cation You can change the title proc freq dataMeasures2 weight count tables confounderexposureresponse cmh title Lung Cancer versus Heavy Drinking Strati ed by Smoking run Logistic regression Refer to SASlogistictxt7 Where l have provided code pertaining to both Example 1 and Example 2 from Lectures 6 and 7 We begin by considering the code for Example 1 The rst step is to read in the data Change ULeukemiaxls to the name of your Excel le7 change the rst Leukemia to Whatever you want to call your data inside SAS7 and change the second Leukemia to the name of the sheet in your Excel le As alvvays7 make sure that the Excel le is closed before you read in the data PROC IMPORT DATAFILE ULeukemiaxls OUT Leukemia DBMS EXCEL REPLACE SHEET Leukemia GETNAMES YES RUN The second step is to verify that the data have been read in which will also let you see if SAS has replaced any special characters in the variable names by underscores Change Leukemia to Whatever you are calling your data inside SAS PROC PRINT DATA Leukemia RUN The third segment of code ts a logistic regression model presuming that you have already decided What variables to include The analysis is thor ough in that you will get diagnostic output and a plot of the receiver op erator curve The word DESCEND tells SAS that the event of interest has occurred When Y 1 rather than When Y 0 Replace Leukemia by Whatever you are calling your data inside SAS replace death by the name of your response variable and replace ag wbc by the names of your explana tory variables This code calls for information about estimated sensitivity and speci city When q 03O40506 07 We start at 03 and nish at 07 incrementing upward in steps of 01 If you want to start and nish at different values of q or to change the size of the increment you can do so by changing 03130 07 by 01 PROC Logistic data Leukemia DESCEND model death ag wbc in uence ctable pprob03 to 07 by 0 outroc roc1 output OUTsupplement pprob lowerlower upperupper RUN PROC print datasupplement label RUN symboll ijoin Vnone cblue proc gplot dataroc1 title ROC Curve PLOT sensit1mspec1 vaxis0 to 1 by 1 run The fourth segment of code asks SAS to choose from among candidate ex planatory variables You can change forward to backward or stepwise just as in linear regression and you can change each 05 as well PROC Logistic data Leukemia DESCEND model death ag wbc SELECTIONf0rward SLE05 SLS05 RUN Now we consider the code for Example 2 Again the rst step is to read in the data Besides the path name and le name two other words speci c to this demonstration are NonSmokers the name of Excel sheet in which the data are found and Mortality the name assigned to the data for reference inside SAS The Excel le should be closed before this code is run PROC IMPORT DATAFILE CD0cumem s and Settingsrichc My Documents Birthweightstxls OUT Mortality DBMS EXCEL REPLACE SHEET NonSmokers GETNAMES YES RUN You can print out the data set on screen to see Whether SAS has changed any of the variable names from Excel When analyzing data in SAS you will need to refer to variables by their SAS names PROC PRINT DATA Mortality RUN The next segment of code ts a logistic regression model relating the log odds of perinatal mortality to birthweight Note that the SAS name of the data set in this case Mortality must be speci ed When PROC Logistic is invoked The word DESCEND tells SAS that a death has occurred When the death variable equals 1 rather than When it equals 0 The left side of the model statement identi es the response variable in this case death and the right side identi es the predictor variable in this case bwt The commands before and after the three lines beginning with PROC Logistic tell SAS to save the output to a rich text format le ie7 one that can be opened in Microsoft Word ODS rtf FILE CDocuments and Settingsrichc My Documents Birthweights rtf PROC Logistic data Mortality DESCEND rnodel death bwt RUN ODS rtf CLOSE RUN The next segment of code adds a new variable called bwtkg to the data set Whereas bwt represented birthweight in grarns7 bwtkg represents birthweight in kilograms data MORTALITY set MORTALITY bwtkg mt1000 run Now we t a logistic regression model using bwtkg instead of bwt PROC Logistic data Mortality DESCEND rnodel death bwtkg RUN The segment of code below adds a new variable called bwtng to the data set This variable is the square of bwtkg data MORTALITY set MORTALITY bwtng bwtkgbwtkg run We proceed to t a logistic regression model using bwtkg and bwtng That is7 we express the log odds of perinatal mortality as a quadratic rather than a linear function of birthweight in kilograms PROC Logistic data Mortality DESCEND model death bwtkg bwtng RUN We can include Contrast statements to make SAS provide point and inter val estimates for odds ratios of interest to us Speci cally7 suppose that we want the odds of perinatal mortality for an infant with higher birthweight V divided by the odds of perinatal mortality for an infant with lower birth weight u We do this by placing v u after bwtkg in the contrast statement and 2 v u u v u v u after bwtng PROC Logistic data Mortality DESCEND model death bwtkg bwtng contrast 5 kilograms versus 4 kilograms bwtkg J bwtng 9 estimateexp contrast 15 kilograms versus 05 kilograms bwtkg J bwtng 2 estimate exp RUN Now we remove bwtng but add gest 23 PROC Logistic data Mortality DESCEND rnodel death bwtkg gest RUN The segment of code below adds a new variable called inter to the data set This variable is the product of bwtkg with gest data MORTALITY set MORTALITY inter bwtkggest run We proceed to t a logistic regression model using bwtkg7 gest7 and inter That is7 we incorporate an interaction between the birthweight and gesta tional age variables PROC Logistic data Mortality DESCEND rnodel death bwtkg gest inter RUN Again we can include Contrast statements to make SAS provide point and interval estimates for odds ratios of interest to us Speci cally7 suppose that we want the odds of perinatal mortality for an infant with higher gesta tional age v divided by the odds of perinatal mortality for an infant with lower gestational age u with the same birthweight c We do this by placing v u after gest in the contrast statement and v uc after inter PROC Logistic data Mortality DESCEND model death bwtkg gest inter contrast 1 more week in gestation at 1 kilogram gest J inter J estimateexp contrast 1 more week in gestation at 4 kilograms gest J inter4 estimate exp RUN Metaanalysis Refer to SASmetatxt The segment of code below gives SAS some of the information in Table 1326 You could change the numbers under datalines to perform meta analysis for a different set of studies The rst column just indexes the studies The second column indicates the number of subjects in the second exposure resp7 treatment group this is the group associated With the denominator of the odds ratio The third column indicates the number of subjects in that group Who developed the disease resp7 Who recovered The fourth column indicates the number of subjects in the rst exposure resp7 treatment group this is the group associated With the numerator of the odds ratio The fth column indicates the number of subjects in that group Who developed the disease resp7 Who recovered data Measures3 input Study Number2 Positive2 Numberl Positivel Negativel Numberl Positivel Negative2 Number2 Positive2 EstOdds PositivelNegative2Positive2Negative1 y logEstOclcls W 11Positive11Negative11Positive21Negative2 wsq WW Wy Wy Wysq Wyy clatalines 140 7402 243134711 3 J 2 152 4 72 19 74 9 5 102 18103 15 6 1035902 72510298 89999717 These next segments of code print information like that on pages 1 and 2 of Metapclf In particular7 you will obtain Ef wh ELI 112227 Ef wiyh and k 2 211102399239 gt proc print clataMeasures3 run proc means dataMeasures3 surn var W wsq wy wysq run The segment of code below gives SAS the value of A You can change 26 001402 to Whatever value you calculate for A27 unless that value is nega tive7 in which case you can change 001402 to 0 data Measures4 input Study Nurnber2 Positive2 Nurnberl Positivel Negativel Nurnberl Positivel Negative2 Nurnber2 Positive2 EstOdds PositivelNegative2Positive2Negative1 y logEstOdds W 11Positive11Negative11Positive21Negative2 wstar 11W 014021 wstary wstary datalines 140 7402 24313471 3 J 2 152 4 72 19 74 9 5 102 18 103 15 6 1035902 72510298 89999717 These nal segments of code print information like that on pages 3 and 4 of Metapdf In particular7 you will obtain 251 and 251 proc print dataMeasures4 run proc means dataMeasures4 sum var wstar wstary run Crossover designs I will describe how to replicate my work on SHEETNew of TENNISZModxls7 beginning from SHEETOriginal Copying a sheet Start on SHEETOriginal From the Edit menu7 select Move or copy sheet Check the box Create a copy 7 then hit OK Go to SHEETOriginal2l Click the right mouse button on the name Orig inal27 then select Rename You will have the opportunity to rename Original2 to whatever you want7 provided that your name is not already being used since New is already being used7 you can use Test Finding rows with missing data or gross mistakes If missing data are represented numerically by a number such as 9 or 0 when a number such as 9 or O is impossible for the variable with which you are dealing7 then an easy way to determine whether you have subjects with missing data on that variable or gross mistakes is as follows Go below the data set somewhere In TENNISZModxls7 you could go to cell E90 column E7 row 90 Type in MAX E2 E89 and press Enter on the keyboard7 where E2 and E89 would in general be replaced by the rst and last cells in the column containing values of the variable with which you were dealing If the number you saw appear when 28 you pressed Enter were greater than the largest allowable number for the variable with which you were dealing7 then you would know that you had a missing value or a gross mistake Next7 go somewhere else below the data set In TENNISZModxls7 you could go to cell E91 column E7 row 91 Type in MINE2E89 and press Enter on the keyboard7 where E2 and E89 would be replaced by the rst and last cells in the column containing values of the variable with which you were dealing If the number you saw appear when you pressed Enter were less than the smallest allowable number for the variable with which you were dealing7 then you would know that you had a missing value or a gross mistake You could do the same in TENNISZModxls with Column F Actually nding the locations of the missing data would require you to inspect some or all of the spreadsheet One device that may save time is illustrated as follows Suppose that MAXltE22E89 yielded a number greater than the largest allowable number for the vari able with which you were dealing You could go to another cell7 typing in MAXltE22E45 and pressing Enter Then you could go to another cell7 typing in MAXltE462E89 and pressing Enter If only one of the resulting numbers were greater than the largest allowable number for the variable with which you were dealing7 you would then know that you only had to inspect half of the spreadsheet Removing rows with missing data or gross mistakes We have not dis cussed how to handle missing data in a manner other than simply deleting the observations with data missing on variables with which we are going to deal In TENNIS2Modxls7 you already know that there are missing values and where they are located rows 187 337 467 and 88 Go to row 887 and click on the number 88 Go to the Edit menu7 then select Delete Repeat this step for rows 467 337 and 18 Going in reverse order prevents confusion7 as the rows are re numbered after each deletion Sorting by treatment group Continuing with TENNIS2Modxls7 go to row 857 and press the left mouse button on the number 85 Without releasing the mouse button7 advance upward to row 1 then release This will high light everything in rows 1 through 85 Go to the Data menu7 then select Sort In the Sort by box7 choose Drgord the heading of Column D7 then hit OK E ieacy for individual subjects Go to cell G2 column G7 row 2 Type in E2F2 and press Enter on the keyboard Return to cell G2 Find the small black box at the bottom right corner of cell G2 Press the left mouse button on this black box Without releasing the mouse button7 drag down to row 43 the last subject in Group A then release Go to cell G44 Type in F44E44 and press Enter on the keyboard in the manner indicated previously7 drag down to row 85 the last subject in Group B Finally7 go to cell H2 Type in G2 2 and drag down to row 85 Summarizing e cacy Go to any cell below the data Type in AVERAGEG2G43 to get Tl Type in AVERAGEG44G85 to get dg Type in 12AVERAGEG2G4312AVERAGEG44G85 to get 1T Type in SUMH2 H43 SUMG2 G43 8242 41 to get 5311 note that 42 n1 Type in SUMH44 H85 SUM G44 G85 8242 41 to get 5312 note that 42 n2 Type in SUMH2 H43 SUMG2 G43 8242SUM H44 H85 SUM G44 G85 8242 82 to get 5319001861 Suppose that cell C96 contains sipooled Then in a cell other than C96 type in 12SQRTC96142142 to get 36d Critical valuesl Go to any cell below the data Type in TINV00582 50 get 1582170 052 TYpe in TINV01082 50 get 1582170 102 15821405 Summarizing carryover e ectsl G0 to cell 12 Type in E2F22 and drag down to row 85 G0 to cell J2 Type in I2 2 and drag down to row 85 Type in AVERAGEltI22I43 to get 21 Type in AVERAGEltI442I85 to get 22 Type in SUMJ2 J43 SUMI2 I43 3242 41 to get 3 Type in SUMJ44 J85 SUM I44 I85 3242 41 to get 3 Type in SUMJ2 J43 SUMI2 I43 3242SUM J44 J85 SUM I44 I85 3242 82 to get 32
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'