supersteven 发表于 2014-4-29 09:36 
已经重发数据,刚才发错文件了,不好意思。
数据名修改为tempdata, 请核对一下,predict之后你想得到什么,下面例子我用score
包含
pr probability of a positive outcome; the default
xb linear prediction
stdp standard error of the prediction
* dbeta Pregibon (1981) Delta-Beta influence statistic
* deviance deviance residual
* dx2 Hosmer and Lemeshow (2000) Delta chi-squared influence statistic
* ddeviance Hosmer and Lemeshow (2000) Delta-D influence statistic
* hat Pregibon (1981) leverage
* number sequential number of the covariate pattern
* residuals Pearson residuals; adjusted for number sharing covariate pattern
* rstandard standardized Pearson residuals; adjusted for number sharing covariate pattern
score first derivative of the log likelihood with respect to xb
- use tempdata,clear
- gen kz1=.
- forvalues i=2003/2012 {
- forvalues j=1/17 {
- cap drop resid
- capture noisily logit psize cf_ts div_ts ch_ts cs Q_w if (year==`i' & ind0==`j')
- quietly if !_rc {
- predict zscore if e(sample), score
- replace kz1 = zscore if e(sample)
- cap drop zscore
- }
- }
- }
复制代码