Beruflich Dokumente
Kultur Dokumente
Today...
Course overview
Course objectives
Course details: grading, homework, etc
Schedule, lecture overview
Course Objectives
Introduce you to using STATA and Excel for
Data management
Basic statistical and epidemiologic analysis
Turning raw data into presentable tables, figures and other
research products
Course details
Introduction to Statistical Computing - 1 unit
Schedule 7 lectures, 7 lab sessions, on 7 Tuesdays in a row
Dates: August 4 September 15
Lectures 1:15-2:45
Labs 3:00-4:00
All in China Basin, CBL 6702 (6704 for lab)
Final Project Due 9/22/09
Course details
Introduction to Statistical Computing
Grading: Satisfactory/Unsatisfactory
Requirements:
-Hand in all six Labs (even if late)
-Satisfactory Final Project
-80% of total points
Reading: Optional
Lecturers
Andy Choi
Jennifer Cocohoba
Lab Instructor
Mandana Khalili
1- Introduction to STATA
2- Do files, log files, and workflow in STATA
3- Generating variables and manipulating data with STATA
4- Using Excel
5- Basic epidemiologic analysis with STATA
6- Making a figure with STATA
7- Organizing a project, making a table
Overview of labs
Lab 1 Load a dataset and analyze it
Lab 2 Learn how to use do and log files
Lab 3* Import data from excel, generate new variables and
manipulate data, document everything with do and log files.
Lab 4 Using and creating Excel spreadsheets
Lab 5* Epidemiologic analysis using Stata
Lab 6 Making a figure with Stata
Last lab session will be dedicated to working on the Final Project
* - Labs 3 and 5 are significantly longer and harder than the others
Final Project
Create a Table and a Figure using your own data, document
analysis using Stata.
Due 1 week after last lab session, 20 points docked for each 1
day late.
Course Materials
Course Overview
Final Project
Lectures and Labs (just in time)
Other handouts
Books
STATA
SAS
S-plus, and R
SPS-S
SUDAAN
Epi-Info
JMP
MatLab
StatExact
Does stuff
Statistics, data manipulation, etc
Demo #1
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)
STATA - Buttons
STATA - Menus
Almost every command can be accessed via
menu
Demo #2
Enter in some data
Look at it
Run a couple of commands
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
STATA commands
Descriptive statistics continuous data
summarize [varlist] [, detail]
# obs, mean, SD, range
, detail gets you more detail (median, etc)
ci [varlist]
Mean, standard error of mean, and confidence intervals
Actually works for dichotomous variables, too.
STATA commands
Graphical exploration continuous data
histogram varname
Simple histogram of your variable
graph box varlist
Box plot of your variable
qnorm varname
Quantile plot of your variable to check normality
STATA commands
Descriptive statistics categorical data
tabulate [varname]
Counts and percentages
(see also, table - this is very different!)
STATA commands
Analytic statistics 2 categorical variables
STATA commands
Analytic statistics 2 categorical variables
tabulate [var1] [var2]
Cross-tab
Descriptive options
, row
, col
(row percentages)
(column percentages)
Statistics options
, chi2
, exact
(chi2 test)
(fishers exact test)
Getting help
Try to find the command on the pull-down menus
Help menu
If you dont know the command - Search...
If you know the command - Stata command...
STATA commands
Analytic statistics 1 categorical, 1 continuous
STATA commands
Analytic statistics 1 categorical, 1 continuous
bysort catvar: summarize [contvar]
mean, SD, range of one in subgroup
STATA commands
Analytic statistics 2 continuous
STATA commands
Analytic statistics 2 continuous
scatter [var1] [var2]
Scatterplot of the two variables
Demo #3
In Lab Today
Familiarize yourself with Stata
Load a dataset
Use Stata commands to analyze data and fill
in the blanks
Next week
Do files, log files, and workflow in Stata
Find a dataset!
Website addresses
Course website
http://www.epibiostat.ucsf.edu/courses/schedule/biostat212.html
Computing information
http://www.epibiostat.ucsf.edu/courses/ChinaBasinLocation.html
#computing