Constrained least squares

前端 未结 1 1003
花落未央
花落未央 2021-01-03 06:11

I am fitting a simple regression in R on gas usage per capita. The regression formulas looks like:

gas_b <- lm(log(gasq_pop) ~ log(gasp) + log(pcincome) +         


        
相关标签:
1条回答
  • 2021-01-03 06:31

    Modify your regression as follows:

    gas_b <- lm(log(gasq_pop) - log(ps) ~ log(gasp) + log(pcincome) +
      I(log(pn)-log(ps)) + I(log(pd)-log(ps)) + log(years), data=gas) 
    summary(gas_b)
    

    If b=coef(gas_b), then the relevant coefficients are

    log(pn): b[4]
    log(pd): b[5]
    log(ps): 1 - b[4] - b[5]
    
    0 讨论(0)
提交回复
热议问题