You are on page 1of 39

Introduction to Statistical

Computing in Clinical Research


Biostatistics 212
Lecture 1

Today...

Course overview

Course o!"ectives

Course details# grading$ homewor%$ etc

Schedule$ lecture overview

&here does Stata 'it in(

Basic data analysis with Stata

Stata demos

La!

Course )!"ectives

Introduce you to using ST*T* and +,cel 'or

-ata management

Basic statistical and epidemiologic analysis

Turning raw data into presenta!le ta!les$ 'igures and other


research products

.repare you 'or /all courses

Start analy0ing your own data



Course details
Introduction to Statistical Computing 1 1 unit
Schedule 2 lectures$ 2 la! sessions$ on 2 Tuesdays in a row
-ates# *ugust 3 Septem!er 14
Lectures 1#1412#34
La!s 5#6613#66
*ll in China Basin$ CBL 7262 87263 'or la!9
/inal .ro"ect -ue :;22;6:

Course details
Introduction to Statistical Computing
<rading# Satis'actory;=nsatis'actory
Re>uirements#
1?and in all si, La!s 8even i' late9
1Satis'actory /inal .ro"ect
1@6A o' total points
Reading# )ptional

Course details$ cont
Course -irector
Bar% .letcher
Teaching *ssistants
Custin .are%h Section 1
+lena /lowers Section 2 8Bac9
Tamara Castillo
Baurice <arcia
Lecturers
*ndy Choi
Cenni'er Cocoho!a
La! Instructor
Bandana Dhalili

)verview o' lecture topics

11 Introduction to ST*T*

21 -o 'iles$ log 'iles$ and wor%'low in ST*T*

51 <enerating varia!les and manipulating data with ST*T*

31 =sing +,cel

41 Basic epidemiologic analysis with ST*T*

71 Ba%ing a 'igure with ST*T*

21 )rgani0ing a pro"ect$ ma%ing a ta!le



)verview o' la!s

La! 1 Load a dataset and analy0e it

La! 2 Learn how to use do and log 'iles

La! 5E Import data 'rom e,cel$ generate new varia!les and


manipulate data$ document everything with do and log 'iles.

La! 3 =sing and creating +,cel spreadsheets

La! 4E +pidemiologic analysis using Stata

La! 7 Ba%ing a 'igure with Stata


Last la! session will !e dedicated to wor%ing on the /inal .ro"ect
E 1 La!s 5 and 4 are signi'icantly longer and harder than the others

)verview o' la!s$ cont

)''icial La! time is 5#6613#66$ !ut we will start right a'ter


lecture$ and you can leave when you are done.

)verview o' la!s$ cont

La!s are due the 'ollowing wee% prior to lecture. La!s turned
in late 8less than 1 wee%9 will receive only hal' creditF a'ter
that$ no points will !e awarded. ?owever$ *LL la!s must !e
turned in to pass the class 8even i' no points are awarded9.

La! 1 is paper

La!s 217 are electronic 'iles$ and should !e emailed to your


section leaderGs course email address#
!iostat212Hsection1Iyahoo.com 8Custin9 or
!iostat212Hsection2Iyahoo.com 8+lena9

/inal .ro"ect

Create a Ta!le and a /igure using your own data$ document


analysis using Stata.

-ue 1 wee% a'ter last la! session$ 26 points doc%ed 'or each 1
day late.

Course Baterials

Course )verview

/inal .ro"ect

Lectures and La!s 8"ust in time9

)ther handouts

Boo%s

<etting started with ST*T*
Session 1

Types o' so'tware pac%ages used
in clinical research

Statistical analysis pac%ages

Spreadsheets

-ata!ase programs

Custom applications

Cost1e''ectiveness analysis 8Tree*ge$ etc9

Survey analysis 8S=-**J$ etc9



So'tware pac%ages 'or analy0ing
data

ST*T*

S*S

S1plus$ and R

S.S1S

S=-**J

+pi1In'o

CB.

BatLa!

Stat+,act

&hy use ST*T*(

Kuic% start$ user 'riendly

Immediate results$ response

Lou can loo% at the data

Benu1driven option

<ood graphics

Log and do 'iles

<ood manuals$ help menu



&hy J)T use ST*T*(

S*S is used more o'ten(

S*S does some things ST*T* does not

.rogramming easier with S1plus and R(

R is 'ree

Complicated data structure and


manipulation easier with S*S(

+pi1in'o 8'ree9 is even easier than ST*T*(



ST*T* Basic 'unctionality

?olds data 'or you

Stata holds 1 M'latN 'ile dataset only 8.dta 'ile9

Listens to what you want

Type a command$ press enter

-oes stu''

Statistics$ data manipulation$ etc

Shows you the results

Results window

-emo O1

)pen the program

Load some data

Loo% at it

Run a command

ST*T* 1 &indows

Two !asic windows

Command

Results

)ptional windows

Paria!le list

?istory o' commands

)ther 'unctions

-ata !rowser;editor

-o 'ile editor

Piewer 8'or log$ help


'iles$ etc9

ST*T* 1 Buttons

The usual open$ save$ print

Log1'ile open;suspend;close

-o1'ile editor

Browse and +dit

Brea%

ST*T* 1 Benus

*lmost every command can !e accessed via


menu

-emo O2

+nter in some data

Loo% at it

Run a couple o' commands



Benu vs. Command line

Benu advantages

Loo% 'or commands you donGt %now a!out

See the options 'or each command

Comple, commands easier learn synta,

Command line advantages

/aster 8i' you %now the commandQ9

MCloserN to the program

)nly way to write MdoN 'iles

-ocument and repeat analyses



ST*T* commands
-escri!ing your data

describe [varlist]

-isplays varia!le names$ types$ la!els

list [varlist]

-isplays the values o' all o!servations

codebook [varlist]

-isplays la!els and codes 'or all varia!les



ST*T* commands
-escriptive statistics continuous data

summarize [varlist] [, detail]

O o!s$ mean$ S-$ range

, detail gets you more detail 8median$ etc9

ci [varlist]

Bean$ standard error o' mean$ and con'idence intervals

*ctually wor%s 'or dichotomous varia!les$ too.



ST*T* commands
<raphical e,ploration continuous data

histogram varname

Simple histogram o' your varia!le

graph box varlist

Bo, plot o' your varia!le

qnorm varname

Kuantile plot o' your varia!le to chec% normality



ST*T* commands
-escriptive statistics categorical data

tabulate [varname]

Counts and percentages

8see also$ table 1 this is very di''erentQ9



ST*T* commands
*nalytic statistics 2 categorical varia!les

ST*T* commands
*nalytic statistics 2 categorical varia!les

tabulate [var1] [var2]

MCross1ta!N

-escriptive options
, row (row percentages)
, col (column percentages)

Statistics options
, chi2 (chi2 test)
, exact (fishers exact test)

<etting help

Try to 'ind the command on the pull1down menus

?elp menu

I' you donGt %now the command 1 Search...

I' you %now the command 1 Stata command...

Try the manuals

more detail$ theoretical underpinnings$ etc



ST*T* commands
*nalytic statistics 1 categorical$ 1 continuous

ST*T* commands
*nalytic statistics 1 categorical$ 1 continuous

bysort catvar: summarize [contvar]

mean$ S-$ range o' one in su!group

ttest [contvar], b(catvar)

t1test

oneway [contvar] [catvar]

*J)P*

table [catvar] [, contents(mean [contvar]!)

Ta!le o' statistics



ST*T* commands
*nalytic statistics 2 continuous

ST*T* commands
*nalytic statistics 2 continuous

scatter [var1] [var2]

Scatterplot o' the two varia!les

pwcorr [varlist] [, sig]

.airwise correlations !etween varia!les

MsigN option gives p1values

spearman ["arlist] [, stats(rho p)]



-emo O5

Load a ST*T* dataset

+,plore the data

-escri!e the data

*nswer some simple research >uestions

<ender and ?TJ$ age and ?TJ



In La! TodayR

/amiliari0e yoursel' with Stata

Load a dataset

=se Stata commands to analy0e data and 'ill


in the !lan%s

Je,t wee%

-o 'iles$ log 'iles$ and wor%'low in Stata

/ind a datasetQ

&e!site addresses

Course we!site

http#;;www.epi!iostat.ucs'.edu;courses;schedule;!iostat212.html

Computing in'ormation

http#;;www.epi!iostat.ucs'.edu;courses;ChinaBasinLocation.html
Ocomputing

-ownload R-. 'or Bacs 8'or Stata 16 Server9

http#;;www.microso't.com;mac;otherproducts;otherproducts.asp,(
pid
Sremotedes%topclient

Citri, &e! Server

http#;;apps.epi1ucs'.org;

You might also like