Hi, I would like to know if anyone has any idea of how to run an OLS with constraints? I need to contraint a coefficient estimate in the model equal to 1, and I am not sure how to include it into the OLS estimation... I was hoping to find something like "cnsreg" in STATA.. thank you Soyoko ______________________________________ Ms. Soyoko Umeno Graduate Research Assitant for the Illinois-Missouri Biotechnology Alliance (IMBA) at http://www.imba.missouri.edu/ Ph.D. Student at the Department of Agricultural and Consumer Economics at the University of Illinois at Urbana-Champaign Office Phone: 217-333-3417 or 217-333-0364 Fax: 217-244-4817 Mailing Address: 1301 W. Gregory Dr. MC710, Urbana, IL 61801
Use lm() or glm() with argument 'offset' set to the value of the column whose coefficient must be 1. See help("lm"). - tom blackwell - u michigan medical school - ann arbor - On Wed, 29 Oct 2003, umeno wrote:> Hi, > > I would like to know if anyone has any idea of how to run an OLS with > constraints? I need to contraint a coefficient estimate in the model equal to > 1, and I am not sure how to include it into the OLS estimation... > > I was hoping to find something like "cnsreg" in STATA.. > > thank you > Soyoko > > ______________________________________ > Ms. Soyoko Umeno > Graduate Research Assitant for the Illinois-Missouri Biotechnology Alliance (IMBA) at http://www.imba.missouri.edu/ > Ph.D. Student at the Department of Agricultural and Consumer Economics > at the University of Illinois at Urbana-Champaign > Office Phone: 217-333-3417 or 217-333-0364 > Fax: 217-244-4817 > Mailing Address: 1301 W. Gregory Dr. MC710, Urbana, IL 61801 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
I don't know STATA, but if you want to force a specific regression coefficient to be 1, I think that can be done with the formula. Consider the following: DF <- data.frame(x1=1:6, x2=rep(1:2, 3), y=rep(1:3, 2)) lm(y-x1~x2-1, DF) The formula "y-x1~x2-1" fits a noconstant model, specified by the "-1" of y-x1 regressed on x2. Does this answer the question? spencer graves umeno wrote:>Hi, > >I would like to know if anyone has any idea of how to run an OLS with >constraints? I need to contraint a coefficient estimate in the model equal to >1, and I am not sure how to include it into the OLS estimation... > >I was hoping to find something like "cnsreg" in STATA.. > >thank you >Soyoko > >______________________________________ >Ms. Soyoko Umeno >Graduate Research Assitant for the Illinois-Missouri Biotechnology Alliance (IMBA) at http://www.imba.missouri.edu/ >Ph.D. Student at the Department of Agricultural and Consumer Economics >at the University of Illinois at Urbana-Champaign >Office Phone: 217-333-3417 or 217-333-0364 >Fax: 217-244-4817 >Mailing Address: 1301 W. Gregory Dr. MC710, Urbana, IL 61801 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >