楼主: jzhc9
6835 4

[回归分析求助] 回归后只用一部分变量求拟合值 [推广有奖]

  • 0关注
  • 0粉丝

这个怎么做

大专生

40%

还不是VIP/贵宾

-

威望
0
论坛币
213 个
通用积分
26.2670
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1416 点
帖子
27
精华
0
在线时间
67 小时
注册时间
2012-5-8
最后登录
2021-3-15

楼主
jzhc9 发表于 2015-3-2 18:10:04 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
就比如线性回归y x1 x2 x3 x4,然后只求z=(系数)x3+(系数)x4 这样的,怎么写命令呢?
二维码

扫码加我 拉你入群

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

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

关键词:拟合值 线性回归

沙发
蔚蓝深秀 发表于 2015-3-2 19:05:08
你用的什么软件?matlab 还是其他?

藤椅
蓝色 发表于 2015-3-2 19:59:24
学stata不看手册,很难掌握
这是stata的user guidel里面的


13.5 Accessing coefficients and standard errors
After fitting a model, you can access the coefficients and standard errors and use them in subsequent
expressions. Also see [R] predict (and [U] 20 Estimation and postestimation commands) for an
easier way to obtain predictions, residuals, and the like.
13.5.1 Singleequation
models
First, let’s consider estimation methods that yield one estimated equation with a one-to-one
correspondence between coefficients and variables such as logit, ologit, oprobit, probit,
regress, and tobit. b[varname] (synonym coef[varname]) contains the coefficient on varname
and se[varname] contains its standard error, and both are recorded to machine precision. Thus
b[age] refers to the calculated coefficient on the age variable after typing, say, regress response
age sex, and se[age] refers to the standard error on the coefficient. b[ cons] refers to the
constant and se[ cons] to its standard error. Thus you might type
. regress response age sex
. generate asif = _b[_cons] + _b[age]*age



你看了自己就可以模仿和学习了啊
gen z   = _b[x2]*x2 +  _b[x3]*x3
已有 1 人评分论坛币 收起 理由
SpencerMeng + 20 观点有启发

总评分: 论坛币 + 20   查看全部评分

板凳
jzhc9 发表于 2015-3-5 20:39:26
蓝色 发表于 2015-3-2 19:59
学stata不看手册,很难掌握
这是stata的user guidel里面的
感谢您的帮助,我会看一看用户手册的!

报纸
miffy88 发表于 2016-11-9 19:34:24
gen z= _b[_cons] +  _b[x2]*x2 +  _b[x3]*x3   或者如果变量少的话,可以直接将系数复制过去,gen z = c + b2*x2 +b3*x3
已有 1 人评分论坛币 热心指数 收起 理由
admin_kefu + 20 + 2 热心帮助其他会员

总评分: 论坛币 + 20  热心指数 + 2   查看全部评分

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 19:18