楼主: 1353679112
7023 5

[回归分析求助] 如何找出跑回归所用到的数据? [推广有奖]

  • 3关注
  • 1粉丝

讲师

31%

还不是VIP/贵宾

-

威望
0
论坛币
8786 个
通用积分
13.5948
学术水平
1 点
热心指数
2 点
信用等级
0 点
经验
381 点
帖子
156
精华
0
在线时间
793 小时
注册时间
2017-1-21
最后登录
2025-7-4

楼主
1353679112 学生认证  发表于 2017-11-7 21:20:17 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我有一个问题,就是当你的数据样本有2万个,但是跑回归的时候所用的样本回归为1.5万个,请问怎样精确找出所用到的这1.5万个样本数呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:样本数

回帖推荐

蓝色 发表于3楼  查看完整内容

回归完执行 gen id=e(sample) id=1 就表示参与回归的 Stored results regress stores the following in e(): Scalars e(N) number of observations e(mss) model sum of squares e(df_m) model degrees of freedom e(rss) residual sum of squares e(df_r) residual degrees of freedom ...

沙发
xddlovejiao1314 学生认证  发表于 2017-11-8 07:49:19 来自手机
1353679112 发表于 2017-11-7 21:20
我有一个问题,就是当你的数据样本有2万个,但是跑回归的时候所用的样本回归为1.5万个,请问怎样精确找出所 ...
还有5000个样本没参与回归应该是包含缺失值,你使用keep或drop命令删除缺失值,剩下的就是你参与回归的样本了。祝好运~

藤椅
蓝色 发表于 2017-11-8 08:12:52
回归完执行

gen id=e(sample)
id=1 就表示参与回归的



Stored results

    regress stores the following in e():

    Scalars        
      e(N)                number of observations
      e(mss)              model sum of squares
      e(df_m)             model degrees of freedom
      e(rss)              residual sum of squares
      e(df_r)             residual degrees of freedom
      e(r2)               R-squared
      e(r2_a)             adjusted R-squared
      e(F)                F statistic
      e(rmse)             root mean squared error
      e(ll)               log likelihood under additional assumption of i.i.d.  normal errors
      e(ll_0)             log likelihood, constant-only model
      e(N_clust)          number of clusters
      e(rank)             rank of e(V)

    Macros         
      e(cmd)              regress
      e(cmdline)          command as typed
      e(depvar)           name of dependent variable
      e(model)            ols or iv
      e(wtype)            weight type
      e(wexp)             weight expression
      e(title)            title in estimation output when vce() is not ols
      e(clustvar)         name of cluster variable
      e(vce)              vcetype specified in vce()
      e(vcetype)          title used to label Std. Err.
      e(properties)       b V
      e(estat_cmd)        program used to implement estat
      e(predict)          program used to implement predict
      e(marginsok)        predictions allowed by margins
      e(asbalanced)       factor variables fvset as asbalanced
      e(asobserved)       factor variables fvset as asobserved

    Matrices      
      e(b)                coefficient vector
      e(V)                variance-covariance matrix of the estimators
      e(V_modelbased)     model-based variance

    Functions      
      e(sample)           marks estimation sample

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
黃河泉 + 3 + 3 + 3 好的意见建议

总评分: 学术水平 + 3  热心指数 + 3  信用等级 + 3   查看全部评分

板凳
1353679112 学生认证  发表于 2017-11-8 14:42:22
xddlovejiao1314 发表于 2017-11-8 07:49
还有5000个样本没参与回归应该是包含缺失值,你使用keep或drop命令删除缺失值,剩下的就是你参与回归的样 ...
这是一种方法,但是如果加入很多if条件的话,逐个条件去keep或者drop还是比较繁琐易出错,如果有更简便的方法就更好了

报纸
1353679112 学生认证  发表于 2017-11-8 14:50:45
蓝色 发表于 2017-11-8 08:12
回归完执行

gen id=e(sample)
这种方法可以,我试了下我跑的样本数和id=1的样本数是一样的,多谢,我执行code: regress stores the following in e(N) 说'e' invalid observation number怎么解决?

地板
jane-reality 发表于 2021-1-13 09:11:49
蓝色 发表于 2017-11-8 08:12
回归完执行

gen id=e(sample)
受教了!多谢!ps:蓝色老师太可爱了,整个这么大蓝色字体进行说明

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 05:26