Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane.

Similar presentations


Presentation on theme: "Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane."— Presentation transcript:

1 Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane

2 Today... Course overview –Course objectives –Course details: grading, homework, etc –Schedule, lecture overview Where does Stata fit in? Basic data analysis with Stata

3 Course Objectives Learn how to use STATA Learn practical application of basic epidemiological and statistical concepts using STATA Learn how to turn raw data into presentable tables and figures

4 Course details Introduction to Statistical Computing - 1 unit Lectures: every other Tuesday, 2:45-4:15 Labs: every other Thursday, 2:45-3:45, 4:00-5:00 Grading: Satisfactory/Unsatisfactory Requirements: -Complete all four Labs -Satisfactory Final Project

5 Course details, cont Faculty Mark Pletcher, MD, MPH 502-5986 Mpletcher@epi.ucsf.edu Lee Zane, MD 353-7814 ZaneL@derm.ucsf.edu

6 Overview of lecture topics 1- Introduction to STATA 2- Generating variables and manipulating data with STATA 3- Using Excel 4- Basic epidemiology with STATA 5- Organizing a project, making a table 6- Making a figure with STATA or Excel Lectures are no longer than necessary

7 Getting started with STATA Session 1

8 Types of software packages used in clinical research Statistical analysis packages Spreadsheets Database programs Custom applications –Cost-effectiveness analysis (TreeAge, etc) –Survey analysis (SUDAAN, etc)

9 Software packages for analyzing data STATA SAS S-plus, and “R” SPS-S SUDAAN Epi-Info JMP MatLab StatExact

10 Why use STATA? Quick start, user friendly Immediate results, response You can look at the data Menu-driven option Good graphics Log and do files Good manuals, help menu

11 Why NOT use STATA? SAS is used more often SAS does some things STATA does not Programming easier with S-plus Complicated data structure and manipulation easier with SAS Epi-info is even easier than STATA?

12 STATA – Basic functionality Hold data for you –Stata holds 1 “flat” file dataset only (.dta file) Listen to what you want –Type a command, press enter Do stuff –Statistics, data manipulation, etc Show you the results –Results window

13 Demo #1 Open the program Load some data Look at it Run a command

14 STATA - Windows Two basic windows –Command –Results Optional windows –Variable list –History of commands Other functions –Data browser/editor –Do file editor –Viewer (for log, help files, etc)

15 STATA - Buttons The usual – open, save, print Log-file open/suspend/close Do-file editor Browse and Edit Break

16 STATA - Menus Almost every command can be accessed via menu

17 Demo #2 Enter in some data Look at it Run a couple of commands

18 Menu vs. Command line Menu advantages –Look for commands you don’t know about –See the options for each command –Complex commands easier – learn syntax Command line advantages –Faster (if you know the command!) –“Closer” to the program –Only way to write “do” files Document and repeat analyses

19 STATA commands Describing your data describe [varlist] –Displays variable names, types, labels list [varlist] –Displays the values of all observations codebook [varlist] –Displays labels and codes for all variables

20 STATA commands Descriptive statistics – continuous data summarize [varlist] [, detail] –# obs, mean, SD, range –“, detail” gets you more detail (median, etc) histogram varname –Simple histogram of your variable ci [varlist] –Mean, standard error, and confidence intervals –Actually works for dichotomous variables, too.

21 STATA commands Descriptive statistics – categorical data tabulate [var] –Counts and percentages –(see also, table - this is very different!)

22 STATA commands Analytic statistics – 2 categorical variables

23 tabulate [var1] [var2] –“Cross-tab” –Descriptive options, row(row percentages), col(column percentages) –Statistics options, chi2(chi2 test), exact(fisher’s exact test)

24 Getting help Try to find the command on the pull-down menus Help menu –If you don’t know the command - Search... –If you know the command - Stata command... Try the manuals –more detail, theoretical underpinnings, etc

25 STATA commands Analytic statistics – 1 categorical, 1 continuous

26 bysort catvar: sum [contvar] –mean, SD, range of one in subgroup ttest [contvar], by([catvar]) –t-test oneway [contvar] [catvar] –ANOVA table [catvar] [, contents(mean [contvar]…) –Table of statistics

27 STATA commands Analytic statistics – 2 continuous

28 scatter [var1] [var2] –Scatterplot of the two variables pwcorr [varlist] [, sig] –Pairwise correlations between variables –“sig” option gives p-values

29 Demo #3 Load a STATA dataset Explore the data Describe the data Answer some simple research questions

30 Preview of next week… Getting data into a STATA dataset Generating new variables Labeling variables and values Log files Do files

31 See you on Thursday! Lab 1 due 9/28


Download ppt "Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane."

Similar presentations


Ads by Google