[R] restricted coefficient and factor for linear regression.

From: Oh Dong-hyun <r.arecibo_at_gmail.com>
Date: Fri, 13 Jun 2008 19:23:18 +0200


Hi,

my data set is data.frame(id, yr, y, l, e, k).

I would like to estimate Lee and Schmidts (1993, OUP) model in R.

My colleague wrote SAS code as follows:
** procedures for creating dummy variables are omitted **

My R code is as follows:
##############
library(plm)
dt <- read.table("dt.dta", sep = "\t", header= T)

dt$id <- factor(dt$id)
dt$yr <- factor(dt$yr)
fit.model <- I(log(y)) ~ I(log(l)) + I(log(e)) + yr * id
re.fit.gls <- pggls(fit.model, data = dt)
#################

I've got the following error message:
##### Error message ###############
Error in dimnames(x) <- dn :

   length of 'dimnames' [2] not equal to array extent #### End of Error message############

I would like to figure out three things. 1. How can I restrict coefficient in model? As you can see in SAS code, coefficient of dt1 is restricted to 1. 2. If it is possible to restrict coefficients, it is possible to restrict coefficients of factors? If so, how?

Thanks in advance.

Best,



Dong-hyun Oh
Center of Excellence for Science and Innovation Studies Royal Institute or Technology, Sweden
e-mail: oh.dongh_at_gmail.com
cel: +46 73 563 45 22

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 13 Jun 2008 - 20:33:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 13 Jun 2008 - 21:31:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive