1 / 5
文档名称:

高级社会统计学Lab之stata数据分析2.doc

格式:doc   大小:301KB   页数:5页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

高级社会统计学Lab之stata数据分析2.doc

上传人:yuzonghong1 2018/8/12 文件大小:301 KB

下载得到文件列表

高级社会统计学Lab之stata数据分析2.doc

相关文档

文档介绍

文档介绍:Goals for Today’s Lab
Binary es
Linear probability model (LPM)
Logistic regression
Getting Started
Create your working folder on your desktop. Call it “Lab2”
Drag the file to your working folder: GSS08_small6
Open Stata
Open the do file editor to create a new do file
Type in the set mands to your do file, replacing with your own paths and filenames as appropriate:
cd "drive:directory_name"
capture log close
log using ,replace
Type in a couple of notes to yourself about what this is – . “Lab2 exercise”. Enclose them in /* and */
Type in the rest of the set mands to your do file:
clear all
set memory 500000
use
set more off
We’ll use this do file to type in today’mands and then run the do file. We can also type in mands as we go to see what Stata does.
Today, we return to the GSS to explore regression models with binary es. Let’s look at factors influencing the probability/odds of voting for e Bush in 2004. For our example, we will use the following variables:
pres04, e, region, educ, race, age
mands this lab:
logit (with “or” option),
logistic
Housekeeping:
We need to manipulate some of our variables for our analysis.
First, create a dummy for “voted for bush” and recode missing data:
replace pres04=. if pres04==6

gen bush=0
replace bush=1 if pres04==2
replace bush=. if pres04==.
Next, create a dummy v