Estimating panel model in R How can I estimate

$y_{i,t}=β_{i}x_{i,t}+ϵ_{i,t} \\
β_{i}=γ_{i}z_{i}+η_{i}$

in R ? Moreover, if I have splitted my data set to a train set which will contain 80% of all the i's and then I want to forecast the $y_{i,t}$ for the rest 20% i's  $\forall t$, how can I do it in R ?

Thank you in advance
For linear regression you want to use R's lm() function, like this:

my.model &lt;- lm(response.variable ~ predictor1 + predictor2, data = my.data)


Look at the model using:

summary(my.model)


You can apply this model to a "test" dataset (your 20% split) by using predict(), like this:

predict(my.model, test.data)