楼主: Statachen
23457 101

[讨论]Stata: Resources For Learning Stata [推广有奖]

71
ReneeBK 发表于 2006-5-6 21:09:00 |只看作者 |坛友微信交流群

STATA: Help, Search, Tutorials, Manuals, Website and STB

A. Colin Cameron, Dept. of Economics, Univ. of Calif. - Davis

This September 1999 help sheet gives information on
  • Using Stata help
  • Using Stata search
  • Using Stata tutorials
  • Using Stata manuals
  • Using Stata website
  • Using Stata Bulletin


STATA HELP

Stata has extensive help once you are in the program.

help gives an overview of help

help contents gives many pages of commands
[I have saved this as the text-file contents.txt]

help regress for example gives help on the stata command regress for linear regression

STATA SEARCH

This can give more results than Stata help,
including

search statistics for example gives summary of commands for statistical analysis
search simulation for example gives information oin simulation

STATA TUTORIALS

Stata gives several tutorials that demonstrate various modules.

tutorial contents lists available turorials
tutorial survival for example, demonstrates survival commands

Unfortunately unless you use a graphic interface for Stata these tutorials do not show the graphs.

STATA MANUALS

The documentation is extensive.

The starting point is the User's Guide. You should really look at this.
e.g. [U] chapter 17 means User's Guide chapter 17

The Reference Guide is broken into four volumes
e.g. [R] matrix means Reference manual Matrix commands which is in Reference H-O (vol. 2).
The first of the reference manuals has a useful list of contents at the front.

STATA WEB-SITE

The website has a lot of information.
This includes summary of what Stata does.
For answers to frequently asked questions see http://www.stata.com/support/
Within Stata using search will cross-reference material on this website.

STATA BULLETIN

The Stata Bulletin has more recent code that has not yet appeared in Stata.
The website http://www.stata.com/support/stb/faq has an overview.
The programs can be downloaded free of charge.
But to read the accompanying article requires purchase of the Stata bulletin.
Within Stata using search will cross-reference material in the Stata bulletin.

For further information on how to use Stata go to
http://www.econ.ucdavis.edu/faculty/cameron

使用道具

72
ReneeBK 发表于 2006-5-6 21:22:00 |只看作者 |坛友微信交流群

[下载]Stata 简 介

51576.rar (215.83 KB, 需要: 1 个论坛币) 本附件包括:
  • Stata 简 介.ppt

使用道具

73
ReneeBK 发表于 2006-5-6 21:23:00 |只看作者 |坛友微信交流群

现代医学统计方法与Stata应用
陈峰
中国统计出版社

[分享][下载]陈峰:现代医学统计方法与STATA应用

http://210.72.32.6/cgi-bin/bigate.cgi/b/g/g/http@210.72.32.26/tjshujia/tjjc/t20051212_402295534.htm

[此贴子已经被作者于2006-5-6 21:28:37编辑过]

使用道具

74
ReneeBK 发表于 2006-5-6 21:32:00 |只看作者 |坛友微信交流群
Stat Computing > Stata > Modules

使用道具

75
SPSSCHEN 发表于 2006-5-7 04:08:00 |只看作者 |坛友微信交流群

A little bit of Stata programming goes a long way...

Christopher F Baum1

Abstract

This tutorial will discuss a number of elementary Stata programming constructs and discuss how they may be used to automate and robustify common data manipulation, estimation and graphics tasks. Those used to the syntax of other statistical packages or programming languages must adopt a di erent mindset when working with Stata to take full advantage of its capabilities. Some of Stata’s most useful commands for handling repetitive tasks: forvalues, foreach, egen, local, scalar, estimates and matrix are commonly underutilized by users unacquainted with their power and ease of use. While relatively few users may develop ado- files for circulation to the user community, nearly all will benefit from learning the rudiments of use of the program, syntax and return statements when they are faced with the need to perform repetitive analyses. Worked examples making use of these commands will be presented and discussed in the tutorial.

51598.pdf (232.86 KB, 需要: 1 个论坛币)

[此贴子已经被作者于2006-5-7 4:10:38编辑过]

使用道具

76
SPSSCHEN 发表于 2006-5-7 04:20:00 |只看作者 |坛友微信交流群

[下载]A State Space Approach for Estimating VAR Models

A State Space Approach for Estimating VAR Models

for Panel Data with Latent Dynamic Components

The econometric literature offers various modeling approaches for analyzing micro data in combination with time series of aggregate data. This paper discusses the estimation of a VAR model that allows unobserved heterogeneity across observation unit, as well as unobserved time-specific variables. The time-latent component is assumed to consist of a persistent and a transient term. By using a Helmert-type orthogonal transformation of the variables it is demonstrated that the likelihood function can be expressed on a state space form. The dimension of the state vector is low and independent of the time and cross section dimensions. This fact makes it convenient to employ an ECM algorithm for estimating the parameters of the model. An empirical application provides new insight into the problem of making forecasts for aggregate variables based on information from micro data.

51600.pdf (453.3 KB)

[此贴子已经被作者于2006-5-7 4:23:13编辑过]

使用道具

77
Nicolle 学生认证  发表于 2006-5-7 05:22:00 |只看作者 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

78
hanszhu 发表于 2006-5-7 05:27:00 |只看作者 |坛友微信交流群

使用道具

79
Statachen 发表于 2006-5-8 02:09:00 |只看作者 |坛友微信交流群

[灌水]Stata help for hausman

Stata help for hausman

help hausman dialog: hausman -------------------------------------------------------------------------------

Title

[R] hausman -- Hausman specification test

Syntax

hausman name-consistent [name-efficient] [, options]

options description ------------------------------------------------------------------------- Main constant include estimated intercepts in comparison; default is to exclude alleqs use all equations to peform test; default is first equation only skipeqs(eqlist) skip specified equations when performing test equations(matchlist) associate/compare the specified (by number) pairs of equations force force performance of test, even though assumptions are not met df(#) use # degrees of freedom sigmamore base both (co)variance matrices on disturbance variance estimate from efficient estimator sigmaless base both (co)variance matrices on disturbance variance estimate from consistent estimator

Advanced tconsistent(string) consistent estimator column header tefficient(string) efficient estimator column header -------------------------------------------------------------------------

where name-consistent and name-efficient are names under which estimation results were saved via estimates store. A period (.) may be used to refer to the last estimation results, even if these were not already stored. Not specifying name-efficient is equivalent to specifying the last estimation results as ".".

Description

hausman performs Hausman's specification test. To use hausman, one has to perform the following steps.

(1) obtain an estimator that is consistent whether or not the hypothesis is true; (2) store the estimation results under a name-consistent using estimates store; (3) obtain an estimator that is efficient (and consistent) under the hypothesis that you are testing, but inconsistent otherwise; (4) store the estimation results under a name-efficient using estimates store; (5) use hausman to perform the test

hausman name-consistent name-efficient [, options]

The order of computing the two estimators may be reversed. You have to be careful though to specify to hausman the models in the order "always consistent" first and "efficient under H0" second. It is possible to skip storing the second model and refer to the last estimation results by a period (.).

hausman may be used in any context. The order in which you specify the regressors in each model does not matter, but it is your responsibility to assure that the estimators and models are comparable, and satisfy the theoretical conditions (see (1) and (3) above).

Options

+------+ ----+ Main +-------------------------------------------------------------

constant specifies that the estimated intercept(s) be included in the model comparison; by default, they are excluded. The default behavior is appropriate for models in which the constant does not have a common interpretation across the two models.

alleqs specifies that all the equations in the models be used to perform the Hausman test; by default, only the first equation is used.

skipeqs(eqlist) specifies in eqlist the names of equations to be excluded from the test. Equation numbers are not allowed in this context, as the equation names, along with the variable names, are used to identify common coefficients.

equations(matchlist) specifies, by number, the pairs of equations that are to be compared.

The matchlist in equations() should follow the syntax

#c:#e [,#c:#e[, ...]]

where #c(#e) is an equation number of the always-consistent (efficient under H0) estimator. For instance equations(1:1), equations(1:1, 2:2), or equations(1:2).

If equations() is not specified, then equations are matched on equation names.

equations() handles the situation in which one estimator uses equation names and the other does not. For instance, equations(1:2) means that equation 1 of the always-consistent estimator is to be tested against equation 2 of the efficient estimator. equations(1:1, 2:2) means that equation 1 is to be tested against equation 1 and that equation 2 is to be tested against equation 2. If equations() is specified, options alleqs and skipeqs are ignored.

force specifies that the Hausman test be performed, even though the assumptions of the Hausman test seem not to be met, for example, because the estimators were p-weighted.

df(#) specifies the degrees of freedom for the Hausman test. The default is the matrix rank of the variance of the difference between the coefficients of the two estimators.

sigmamore and sigmaless specify that the two covariance matrices used in the test be based on a common estimate of disturbance variance (sigma2).

sigmamore specifies that the covariance matrices be based on the estimated disturbance variance from the efficient estimator. This option provides a proper estimate of the contrast variance for so-called tests of exogeneity and overidentification in instrumental variables regression.

sigmaless specifies that the covariance matrices be based on the estimated disturbance variance from the consistent estimator.

These options can only be specified when both estimators save e(sigma) or e(rmse), or with command xtreg. e(sigma_e) is saved after command xtreg with options fe or mle. e(rmse) is saved after command xtreg with option re.

sigmamore or sigmaless are recommended when comparing fixed-effects and random-effects linear regression because they are much less likely to produce a nonpositive-definite differenced covariance matrix (although the tests are asymptotically equivalent whether or not one of the options is specified).

+----------+ ----+ Advanced +---------------------------------------------------------

tconsistent(string) and tefficient(string) are formatting options. They allow you to specify the headers of the columns of coefficients that default to the names of the models. These options will be primarily of interest to programmers.

Remark: An alternative to hausman

The assumption that one of the estimators is efficient (i.e., has minimal asymptotic variance) is a demanding one. It is violated, for instance, if your observations are clustered or pweighted, or if your model is somehow misspecified. Moreover, even if the assumption is satisfied, there may be a "small sample" problem with the Hausman test. Hausman's test is based on estimating the variance var(b-B) of the difference of the estimators by the difference var(b)-var(B) of the variances. Under the assumptions (1) and (3), var(b)-var(B) is a consistent estimator of var(b-B), but it is not necessarily positive definite "in finite samples", i.e., in your application. If this is the case, the Hausman test is undefined. Unfortunately, this is not a rare event. Stata supports a generalized Hausman test that overcomes both of these problems. See suest for details.

Examples

Typing

. xtreg lny educ age, fe . est store fixed . xtreg lny educ age sex, re . hausman fixed .

presents Hausman's specification test, which tests the appropriateness of the random-effects estimator (xtreg, re).

Typing

. mlogit travmode age gender income . est store all . mlogit travmode age gender income if travmode != 2 . est store partial . hausman partial all, alleqs constant

will perform a Hausman test for independence of irrelevant alternatives (IIA).

When one estimator uses equation names and the other does not, specify the equations() option to force the comparison. This is illustrated in the comparison of the OLS estimator and the estimator of the regress part of the heckman model

. regress mpg price . est store reg . heckman mpg price, sel(foreign=weight) . hausman reg ., eq(1:1)

Comparison of the probit and selection model of the heckman

. probit foreign weight . est store probit_for . heckman mpg price, sel(foreign=weight) . hausman probit_for ., eq(1:2)

Also see

Manual: [R] hausman

Online: lrtest, suest, test, xtreg, xtregar

[此贴子已经被作者于2006-5-8 2:12:07编辑过]

使用道具

80
Statachen 发表于 2006-5-8 02:24:00 |只看作者 |坛友微信交流群
Panel-data models
29.14.1 Linear regression with panel data
29.14.2 Censored linear regression with panel data
29.14.3 Generalized linear model with panel data
29.14.4 Qualitative dependent variable models with panel data
29.14.5 Count dependent variable models with panel data
29.14.6 Random coefficient models with panel data

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-24 10:24