[R] constrained OLS on coefficient

Spencer Graves spencer.graves at pdf.com
Wed Oct 29 20:29:27 CET 2003


      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
>  
>




More information about the R-help mailing list