R: Least squares estimation in linear equation systems

67 views Asked by At

I'm going to estimate some parameters of linear equation systems with repeated measures. My equations will look like this:

Variant1: X_i + K_j + X_ij = K_ij

Variant2: X_i + K_j + x_ij * X_i * K_j = K_ij

At least 10 values (repeated measures; technical replicates) are known for every K_j and K_ij. I want to estimate the values for X_i and X_ij resp. x_ij.

Additionally I'd like to know the standard error of these estimates, if possible.

In R, my data set would look like this (in reality I have :

i <- rep(1:3, each = 30)
j <- rep(rep(1:3, each = 10), 3)

K.i  <- rep(c(6, 5, 10), each = 30) + rnorm(90)
K.ij <- K.i + rnorm(90)

# X_i, X_ij and x_ij should be 0 (since I assumed K_j being K_ij + normal noise

data <- cbind(i, j, K.i, K.ij)

How can I estimate the expected parameter values (minimizing the sums of squares) and the standard errors of these estimates in R?

Thanks a lot in advance for your help!

0

There are 0 answers