全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6794 4
2015-03-02
就比如线性回归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
二维码

扫码加我 拉你入群

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

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

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

扫码加我 拉你入群

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

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

2016-11-9 19:34:24
gen z= _b[_cons] +  _b[x2]*x2 +  _b[x3]*x3   或者如果变量少的话,可以直接将系数复制过去,gen z = c + b2*x2 +b3*x3
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群