Epi 202 SAS Code Documentation.docx - Epi 202 SAS Code Documentation Crude and Stratified Tabular Analyses This document describes the mechanics of and

Epi 202 SAS Code Documentation.docx - Epi 202 SAS Code...

This preview shows page 1 - 3 out of 27 pages.

Epi 202 SAS Code Documentation: Crude and Stratified Tabular Analyses This document describes the mechanics of and how to use the following SAS code files: epi202_count_data.sas epi202_person_time.sas epi202_case_control.sas As researchers, our data is usually not given to us in tabular format. Instead, we work with datasets that have row(s) of observations for each of the participants in our study and columns with different variables we have collected information on from our participants. An example of such a dataset, evans_example_dat.csv has been provided to you on the course website. This dataset has been adapted from the Evans County dataset provided by the R package lbreg. In the version provided to you, we have kept the three variables of interest and additionally generated a variable for person-time and case- control selection so that you can will be able to conduct closed cohort, open cohort, and case-control analyses all on the same example data. Briefly, the Evans County study followed white males for incident coronary heart disease for 7 years. For the purposes of these examples, we are going to assume no loss to follow-up or competing risks. For your reference, the variables in the dataset are coded as follows: CHD: a binary indicator of outcome status where 1=incident CHD case and 0=non-case HTN: a binary indicator of exposure status where 1=hypertensive and 0=not hypertensive at baseline SMK: a binary of smoking status where 1=smoker and 0=non-smoker at baseline person-time: a continuous variable representing amount of person-time under follow-up prior to a CHD event or administrative censoring at the end of follow-up (maximum=7) caco: a binary indicator of case status for participants selected into a nested case-control study; ’case’=case and ’control’=control. For participants not selected to the case-control study, it is set to ‘NA’ 1) Analyses for count data Crude Analyses The SAS code to conduct analyses, both crude and stratified, for count data, such as might arise in a closed-cohort setting, is contained in the file epi202_count_data.sas. To begin these analyses, we have to import our data using proc import. When doing this, we create a dataset in the working directory called ‘dat’ that is used for all of our subsequent analyses. In order for proc import to work properly, we must be careful to give the correct file location (in this example, the ‘evans_example_data.csv’ file is stored in the folder ‘Epi 202 2018’ in my P drive) as well as the file type (here, a csv file). /*Call in data*/ proc import out= WORK.dat DATAFILE= "P:\Epi 202 2018\evans_example_data.csv" DBMS=csv REPLACE; GETNAMES=YES;
Image of page 1
RUN; In the next step, we create indicator variables to represent the following types of individuals we observe: exposed cases, exposed non-cases, unexposed cases, and unexposed non-cases. To do this, we use ‘if’ statements and the values of our exposure and outcome variables. In the example below, I first drop
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 27 pages?

  • Summer '14
  • FrancisCook

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes