Title: Teaching with Stata
1Teaching with Stata
- Alan C. Acock
-
- Peter Lachenbruch
- Oregon State University
- alan.acock_at_oregonstate.edu
- peter.lachenbruch_at_oregonstate.edu
2Teaching with Stata in a SPSS College
- When I started teaching with Stata
- 90 of the faculty used SPSS
- 10 used SAS
- Stat Transfer is a powerful argument
- SPSS can save a Stata file for people use to
using SPSS for data management - Faculty using SPSS rely mostly on its excellent
menu system - Students who know Stata can use SPSS menu
2
3Need Colleagues
- College had good fortune of hiring Tony
- Impeccable statistical qualifications
- Long history of using Stata
- Use Statas strengths to get colleague support
- Long Freese Limited Dependent Variables
- gllamm
- Complex sample capabilities
- ice, mim
- Many of these are user written
4Need Colleagues
- College Methodology Core presentations
- Students presentations doing things not possible
with SPSS - Recruit Faculty Projects to using Stata have
Faculty presentations - Emphasize what Stata can do rather than attacking
SPSS--advantages are obvious - Faculty inertia is like herding cats
5Its Hard to Convince Menu Addicts
- Most colleagues have a research team need to
coordinate their work - Need to plan data management analysis
- Need to maintain a record of all changes to data
- Need to have comments
- Need to organize understand datasets
- Need to replicate data modifications
- Need to replicate results
- Need to do revise resubmit re-analysis
6Convincing Menu Addicts
- Appropriate use of menu system
- Nobody ever needs to replicate your results
- No other people working as part of a team
- All your manuscripts are published without need
for revisions - Learning about options w/o reading the manuals
- I use them with graphs then copy to a do-file
7Convincing Menu Addicts
- Refuse to help student w/o all relevant do-files
- I should be able to stick their flash drive in my
PC and have their data created and analyzed - Require appropriate comments
- Students never imagine how much they can forget
- Need write comments so somebody else can use the
program
8Command Structure--Statas Great Strength
- I show the Stata program in class
- I require the Stata program to be submitted with
all labs - In presentations, I sometimes show SPSS or SAS
code that can duplicate Stata - without stressing how bizarre it is
- type a little, get a little is compelling by
comparison to SPSS/SAS - regress y x1 x2, beta
- logit y x1 x2, or
- poisson y x1 x2
- factor x1 - x12, pcf
9Working with Graphs
- Many introductory statistics courses minimize
graphic presentations - Many students colleagues rely on Excel for
graphs - Stata 10 has a professional quality graphs
- Graphics editor in Stata 10 gives students a
sense of efficacy it is hard to get with most
statistics procedures - Stress knowing their audience--bar chart or
histogram may be most effective for non-technical
audience - Stress need to have strong statistical evidence
behind the graph, even when not reported - Two-way graphs with multiple overlays--scatter,
linear, quadratic
10What to do in Labs--Motivations
- My undergraduates are in the social
behavioral/health sciences - All state programs in Oregon are required to
justify their existence on a regular basis - Funding for new programs is part of many
positions - Substantive content gets first job ability to
write/evaluate program proposals get promotions - Labs focus on statistics/graphs, data access,
analysis that facilitate evaluating programs
10
11What to do in Labs--Activities
- Class/group conduct a survey near start of course
- N of 100 is nice, 50 is critical
- Let class/group pick the topic
- Each enters some data then use append
- Label variables, values, missing values
- Create a scale using rowmean/rowtotal
- Cover alpha after corr
- Use their survey data to write short advocacy
- Use their survey for several types of analysis
11
12What to do in Labs--Activities
- Class/group survey
- Require them to have some items that are not
simple to code - Skips
- Select all that apply
- Ranking of five items
- This helps them with coding, data entry, data
management tasks - Lab reports should emphasize interpretation
rather than just getting the right number.
12
13What to do in Labs--UCLA Stata Portal
- Give them assignments to find instruction on
selected topics, for example - http//www.gseis.ucla.edu/courses/ed230a2/notes/ef
fect.html for effect size - Search Statas FAQ for some topic we provide
- Do exercise based on UCLA video
- Students played jeopardy as review for tests
- Elements of research methods introduced wherever
I canThis helps to make statistics seem more
relevant
13
14What to do in Labs--Activities
- Use real data for most analyses
- Require some data management for many of the
assignments - W/O this, they quickly forget how to manage data
- W/O this, they dont understand importance of
data management - Require a do-file for many of the assignments
- Regular use of display for calculations gets them
used to keeping Stata open
14
15What to do in Labs--Activities
- Have them keep a portfolio
- Include all lab activities
- Include notes from lecture
- Include exercises they did that were not required
- Include activities for class
- I give them full credit if this looks fairly
complete. It is a small portion of the grade - They often go back to these in subsequent
coursework
15
16What User Written Commands?
- Introductory graduate statistics can utilize user
written commands - Here are some I like them to have in first year
course - fre
- Those who have SPSS background love this
- ice, mim, misschk
- Missing values are a profound problem in
social/behavioral/health sciences
16
17What User Written Commands?
- Here are a couple more user written commands
- Long Freese commands for categorical count
outcomes - corrtab
- Nicer display of correlations including
significance - I use this when searching for examples of small,
medium, large correlations for lecture use - pathreg
- This does path analysis quite simply insures
each equation has same N.
17
18What User Written Commands?
- More user commands I include for data management
- Center
- Simple, but useful
- User written commands like this are a great way
to introduce them to writing their own commands - zscore
- revrs
- Handy for reversing scores on ordinal variables
18
19What User Written Commands?
- User written commands I use as teaching tools to
help students visualize. Many students find a
visual approach more accessible than a
mathematical approach - beamplot mpg, over(rep78)
- Balance mean for interval over categorical
variables - clt
- Nice demo of Central Limit Theorem
- chidemo df p for df 1, 5, 30, 50 reminds them
of the CLT - cordemo
- Does r .5 mean the relationship is strong?
19
20What User Written Commands?
- User written commands I use as teaching tools
- pwrdemo2, n(x) diff(x) alpha(x)
- Where diff is the effect size
- Helps students understand effect size concept
that is widely used in psychology - ftable, ttable, ztable
- Students often forget their textbook
- Simanova
- Unequal Ns do not matter much when variances are
similar - Unequal variances do not matter much when Ns are
similar - When both are unequal the nominal alpha is
meaningless.
20
21Classroom Management
- We have a server that any student can access from
anyplace with internet connectivity - We have a cart with 25 very cheap laptops that
basically work as dumb terminals to connect to
server - Many students bring their own laptops
- Biggest problem is to keep them from email/web
browsing/game playing - Apply cell phone policy to laptops
- Walk around room or have lab assistant sit at
back to monitor
21
22Classroom Management
- Lecture focuses on statistics lab on Stata--but
some computer work during lecture - Reinforces what they are being taught
- Keeps them awakeespecially if they are doing it
- Students can easily produce the correct
statistics using Stata, but they have difficulty
interpreting the results - A statistically significant result can be trivial
- A confidence interval may highlight that a result
is trivially different from zero effect - Need to assess both substantive statistical
significance - Discuss pitfalls such as explaining rare events
- Simulations can help them understand assumptions
22
23Room for Improvement
- corr does not give significance, just pwcorr or
corrtab. Beginners do not understand why. - Effect size post estimation command for all
appropriate testsAPA expects to see effect size
reportedwould open up a huge market - Add icon on menus that will copy command at the
end of the do-file, if only one do-file is open - Enhance do-file editor
- Add professional quality three-dimensional
graphics
23
24Room for Improvement
- Missing values package including complex survey,
longitudinal, multilevel data - Develop factor analysis commands
- Nice to have some way that Stata could validate
the most powerful user written commands - Need book who how to systematically manage data
using Statamore than just the commandsincluding
the philosophy behind it
24
25Room for Improvement
- Need menu icon in Stata to copy directly to a
do-file - Experienced users often have several concurrent
do-files Stata wouldnt know which do-file
should get the command - Beginning students usually have a single do-file
- Single click option would be nice, when you have
only one do-file open
25
26Discussion Topics
- Experience gaining support for Stata
- Barriers
- Solutions to overcome barriers
- Ideas for Labs
- Favorite user written commands for beginners
- Instruction
- Data Management
- Analysis
- Suggested Stata enhancements to make it a better
tool for instruction
26