楼主: mimolee007
16845 3

[回归分析求助] 求问,如何加入限制条件进行回归分析? [推广有奖]

  • 0关注
  • 0粉丝

小学生

78%

还不是VIP/贵宾

-

威望
0
论坛币
9 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
59 点
帖子
6
精华
0
在线时间
6 小时
注册时间
2013-10-30
最后登录
2014-1-16

楼主
mimolee007 发表于 2013-11-4 17:10:23 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币


限制条件1:a1=a2(a1,a2为自变量x的各个系数)

限制条件2:a1+a2+a3=1(a1,a2,a3为自变量x的各个系数)

限制条件3:a1=a2 and a1+a2+a3=1 (a1,a2,a3为自变量x的各个系数)


如何在回归中用以上各个限制条件?


reg y x1 x2 x3 是没有加入任何限制条件的回归。

非常感谢!!!
二维码

扫码加我 拉你入群

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

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

关键词:回归分析 限制条件 如何加入 非常感谢 自变量 回归分析 如何

回帖推荐

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

看手册上cnsreg的详细例子 [R] cnsreg -- Constrained linear regression Examples Setup . sysuse auto Constrain coefficients of price and weight to be equal . constraint 1 price = weight Fit constrained linear regression . cnsreg mpg price weight, constraints(1) Define more constraints . constraint 2 displ = weight ...

沙发
蓝色 发表于 2013-11-4 18:54:47

看手册上cnsreg的详细例子

    [R] cnsreg -- Constrained linear regression


Examples

    Setup
        . sysuse auto

    Constrain coefficients of price and weight to be equal
        . constraint 1 price = weight

    Fit constrained linear regression
        . cnsreg mpg price weight, constraints(1)

    Define more constraints
        . constraint 2 displ = weight
        . constraint 3 gear_ratio = -foreign

    Fit constrained linear regression, applying all three constraints
        . cnsreg mpg price weight displ gear_ratio foreign length, c(1-3)

    Constrain constant to be zero
        . constraint 99 _cons = 0

    Fit constrained linear regression, applying all four constraints
        . cnsreg mpg price weight displ gear_ratio foreign length, c(1-3,99)

藤椅
mimolee007 发表于 2013-11-4 20:09:56
蓝色 发表于 2013-11-4 18:54
看手册上cnsreg的详细例子

    [R] cnsreg -- Constrained linear regression
試過了!真的OK咯~
非常感謝!!!

板凳
yanhuanxiu 发表于 2020-3-5 00:17:03
蓝色 发表于 2013-11-4 18:54
看手册上cnsreg的详细例子

    [R] cnsreg -- Constrained linear regression
这个Constrained linear regression可以用在面板数据吗

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-2 03:58