Sadistics For Dummies - AMDA Foundation

Download Report

Transcript Sadistics For Dummies - AMDA Foundation

Sadistics For Dummies
(and how to lie excel with statistics)
Stefan Gravenstein, MD, MPH
Professor
Division of Geriatrics
Warren Alpert Medical School
Overview
 Basic definitions
 Sampling
 How to organize hypothesis tests
 Power
 Testing
 How to select further analyses
SAMPLING
EXAMPLE
Pretest (T/F)
1)
Mode is an average
2)
p = probability
3)
Chi square is for
continuous variables
4)
Ordinal is a description of
a continuous variable
5)
Censored data relates to
not publicly approved
data
6) Means are distorted by
outlier values
7) Geometric means are
useful if log distribution is
symmetric
8) Median is an average
9) Gender is ordinal
10)Power is great
Basic Definitions
 Types of data
 Numerical (quantitative)
 Continuous
 Discrete
 Categorical (qualitative)
 Nominal (no order inferred—e.g. blood group, gender,
old vs. young)
 Ordinal (order inferred—e.g. weak vs. strong, old vs.
young)
Different Types of Variables
Categorical
(qualitative)
Nominal
Categories are
mutually exclusive and
unordered (gender,
race, blood group,
fever presence, culture
+)
Numerical
(quantitative)
Ordinal
Categories are
mutually exclusive and
ordered (mild
/moderate /severe;
code status)
Discrete
Continuous
Integer values,
typically counts (sick
days/year, number
of meds or phone
calls)
Takes any value in a
range of values
(weight, height, Hb,
Na, distance run,
blood pressure)
Demographics of a Study Sample
Field TS, Gurwitz JH et al. Arch Intern Med 2001;161:1629-34.
Derived Data
 Percentages
 When considering improvements with intervention
(e.g. FEV1, LOS)
 Ratios
 BMI (weight/height2) for overweight or underweight
 Rates
 Disease rates in which the # of disease events
occurring among individuals in a study is divided by
the total # of years of f/u of all in that study
 Scores
 QOL survey, MMSE, GDS, Braden Scale
Censored Data
 Data points that are not reported
 Laboratory values where there is a limit to detection or isn’t
collected
 UTI in absence of culture
 Patients lost to follow-up
 Intention to treat is an example of how we deal with this
Basic Definitions
 Average
 Mean, weighted mean, geometric mean
 Median
 middle value of an ordered set,
 or the average of those two values about the middle
 Mode: the most frequent value or group of values
Mean
Mode
Median
Arithmetic Mean
Average Advantages
Type
Advantages
Disadvantages
Mean
Uses all the data values
Algebraically defined
Known sample distribution
Distorted by outliers
Distorted by skewed data
Median
Not distorted by outliers
Not distorted by skewed data
Ignores most of the info
Not algebraically defined
Complicated sampling
distribution
Mode
Easily determined for categorical data
Ignores most of the info
Not algebraically defined
Unknown sampling distribution
Geometric
Mean
Before back-transformation, same
advantages as mean
Appropriate for skewed data
Only appropriate if the log
transformation produces a
symmetrical distribution
Weighted
Mean
Same advantages as mean
Weight must be known or
Ascribes relative import to ea observation estimated
Algebraically defined
Descriptive Statistics in Excel
 Assume pain scores are 3, 0, 4, 4, 4, 2, 4, 1, 4, 0, 3, 3, 1, 1, 3 (enter
into column B)
 =average(values)
Same way for count, max, min, median
 Logic: =if(test condition,what to do if true, what to do if false)
=if(a1=b1,””,1) [test data entry]
Note: excel cells are ID’d by a column-row
nomenclature
start with “=“, no spaces, expect relative ref’s;
Absolute refs start with “$” before column/row to
lock
http://phoenix.phys.clemson.edu/tutorials/excel/index.html
Normal Distribution
(continuous data)
Mean
Median
Mode
34.1 %
 Bell shaped, symmetric about the mean
 Define by mean and standard deviation
 68% of data points lie within 1 sd of mean
 95% lie within 1.96 sd of mean
 99% lie within +/- 2.58 sd of mean
+1sd
-1sd
Mean
 Area under curve = 1
 sd to point on curve is the z-score
 The z-score sum of a population = 0
-1sd
Means
+1sd
Inferential
Statistics
 Descriptive statistics: means, sd, averages, counts,
frequencies (describe data)
 Inferential statistics: likelihood estimates of conclusion
drawn from data is correct
 Point estimation, interval estimation or hypothesis testing
 t-tests, chi-squares, ANOVAs, life tables, etc.
 Goal: minimize random error (draw wrong conclusion)
 all estimates differ from true value based on random
sample; some difference from true ALWAYS exists
 some treatment outcome/association will always
measure as better or worse
Sampling
 Testing “all” is unfundable, so usually sample
from a population of interest
 Sample selection bias
 Convenience
 Coercion
 Cultural
 Random sample of population, and of sample
 Divide population sampled into two groups randomly
for treatment, and compare outcome
 If we test once, one group will outperform other
(sample means differ)
Example
 Port Moresby, New Guinea: well-endowed M
 Mangro (boiled oil of bamboo stalks) .5”
 Population: 6.4” and sd 1.25” and n=3100
www.sizesurvey.com/result.htm
 Sample population: 6.7” after 6 weeks, n=100
Is this more or is this chance?
 How likely is it to find a sample mean of 6.7”
from a single study?
t-distribution
(Student’s t-distribution)
 Degrees of freedom
 Number of variables (groups of data) that are free to move
relative to reference variables (group of data) (n-1)
 Or, the number of unique bits of information
 For tables, the #of rows-1 times the #of columns -1
 2x2 table has 1 df, 2x3 has 2df, and 4x6 has 15df
-1sd +1sd
Mean
 Four columns of categorical data has 3df
 GREAT for getting confidence intervals and testing
hypotheses about one or two means
Chi-Squared distribution
 Characterized by the degrees of freedom
 Especially useful for categorical data analysis
 Think about using it for data that can be summarized in a
table (categories for rows and columns) (GREAT for
tabular data)
df = 5
don’t use for percentages!
df = 10
df = 15
F-distribution
 Right-skewed
 Defined by a ratio
 Uses degrees of freedom of the numerator and denominator
of the ratio
 Used most to compare to variances, and more than two
means with ANOVA
SOooo
 Let’s do some Excel!
 Open MSExcel
 Open file:
 Stats for Dummies.xls
 Correl.xls
Data Entry
 Spreadsheet or database is preferred place to start
 Can save as a text file to move to a formal stats program, or
do simple statistics in spreadsheet or database program
 Think about the data form you will collect data on—
forms/questionnaires can be designed to reduce later work
(e.g., check boxes or codes for all responses of categorical
data)
 How can you be sure you entered the data correctly (leave
space for checking)?
Categorical: Multicoded variables
 With a few possibilities (e.g., a few symptoms) can
aggregate combinations or do individual (cough/sore
throat/ runny nose/ feverish)
 When many possibilities exist, might group differently
(e.g., with symptoms, which was first or which occurred in
the first 48 hours)
 Need to limit number collected
 Need to pilot what makes sense before committing to an
approach
Keeping Track of Data
 Multiple forms per patient
 Collecting data on patient on more than one occasion—
identify/code by person so it can be linked later
 Dates and times
 Record in a consistent way (d/m/y vs m/d/y)
 What to do with missing values
 Assign a symbol or dummy variable (*, 9999 or -99)
 Make sure it doesn’t apply to a specific subgroup
Error Checking
 Typing errrors
 Double entry
 Logic query
 Range check, e.g., check if dates are in expected range,
such as for birth date)
 In categorical data-unallowed values
Outliers
 Eyeball
 Decide in advance how to deal with
this
 Consider whether the
inclusion/exclusion changes the
interpretation of the result
 May need to do additional data
manipulation (e.g. transform data) or
use different statistical test (nonparametric)
Hypothesis Tests:
Picking the Right Test
 Is it numerical data or categorical data?
 How many groups?
 Paired or independent?
Statistical Tests Based on Data
Type
Outcome Variable
(Response or Dependent Variable)
Continuous
Categorical
T-test
Continuous
ANOVA
Linear Regression
Chi-square
Categorical
Logistic Regression
Odds Ratio
Numerical Data
• 1 group  one sample t-test or sign test
• 2 groups
– Paired
•
Paired t-test, sign test, or Wilcoxon signed ranks test
– Independent
•
Unpaired t-test, Wilcoxon rank sum test
• > 2 groups
– Independent
•
Unpaired t=test, Wilcoxon rank sum test
Categorical Data
• 2 categories (investigating proportions)
Category Labels
– 1 group
• Z test for a proportion, Sign test
– 2 groups
• Paired  McNemar’s test
• Independent  Chi-squared test, Fisher’s exact test
– > 2 groups
• Chi-squared test, Chi-squared trend test
• > 2 categories
– Chi-squared test, cross-tabulation
Further analyses: what next?
•
Regression
–
–
•
Longitudinal
–
•
Logistic, Poisson, repeated measures, survival analysis
Assessing evidence
–
•
Correlation
•
Correlation coefficients, Pearson’s, Spearman’s
Regression
•
Simple, multiple, logistic, Poisson, modeling, cluster
Evidence-based medicine, systematic reviews (e.g. Cochrane), meta-analysis
Additional topics
–
Diagnostic tools
•
sensitivity, specificity; agreement-kappa; Bayesian methods
Power Calculation
 How do you decide how
many data points (subjects)
you need to study to get
your answer?
 Lenth, R. V. (2006). Java
Applets for Power and
Sample Size [Computer
software]. Retrieved month
day, year, from http://www.
stat.uiowa.edu/~rlenth/
Power.
 Follow instructions for
download
What does it all mean?
 P-value
 the probability of finding a value as extreme or more
extreme than the t-statistic, assuming the null hypothesis is
true
 p < .05 is a result that says this outcome would be
expected to occur by chance less than 5% of the time
 p < .01 is a results that says this outcome would be
expected to occur by chance less than 1% of the time
Confidence Interval vs. Significance
Testing
 Mathematically it can be shown that
confidence interval estimation and
significance testing yield identical conclusions
 Confidence interval estimation has gained in
popularity in the scientific community. Some
have even advocated the use of confidence
intervals over testing hypotheses with P-values
Summary
 Think about your question
 Decide what kind of data you are collecting
 Develop your hypothesis
 Pick your test
 Pick your sample size: you have the power
 Collect your data
 Get your results
Post Test (T/F)
1)
If p < .001, conclude
cause  effect
6) Use non-parametric tests to
deal with outliers
2)
t-test = 2-sample ANOVA
3)
Use power to select
sample size
7) Spearman’s & Pearson’s
can be calc. in Excel
4)
Categorical data are
described as ordinal and
nominal
5)
Chi-square is great for
categorical data
8) Spearman’s deals with
outliers
9) Fever onset from symptom
onset is normally distributed
10) Power is great
Types of Decisions, Errors
and Their Probabilities
Decision
True State of
Nature
H0 True
Fail to Reject H0
Reject H0
Correct Decision
1-
Type I Error

Type II Error

Correct Decision
Power = 1 - 
HA True
The Odds Ratio
Exposure
(Resident Characteristic)
Yes
No
Disease
(Adverse event)
Yes
A
B
No
C
D
AD
OR 
BC