Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indices to variables #108

Open
ChristophHanck opened this issue Sep 24, 2020 · 6 comments
Open

Indices to variables #108

ChristophHanck opened this issue Sep 24, 2020 · 6 comments
Labels
enhancement New feature or request new model
Projects

Comments

@ChristophHanck
Copy link

Great initiative!

Often, regression equations are reported so as to indicate the dimensions over which variables vary, like in (LaTeX)
$$
y_i=\beta_0+\beta_1x_i+u_i,
$$
typically for cross-sectional data,
$$
y_t=\beta_0+\beta_1x_t+u_t,
$$
for time series models and something like
$$
y_{it}=\beta_{0,i}+\beta_1x_{it}+u_{it}
$$
for panel data models. Could that be incorporated as an option?

@datalorax
Copy link
Owner

Hi, thanks for your interest! Yes, I think that could be incorporated pretty easily. I have a few other things I'm working on that are a little higher priority for me, but I will circle back to this when I have the time. I'd also welcome a PR if you feel up for that.

@datalorax datalorax added the enhancement New feature or request label Sep 24, 2020
@datalorax datalorax added this to To do in v0.2 Oct 13, 2020
@datalorax
Copy link
Owner

Hi - circling back to this (about a year later). Can you possibly expand on this a bit? Apparently it made sense to me when you opened this issue but now that I'm revisiting it I'm not actually sure what's being requested. We now support mixed effects models, which vary randomly. But I'm thinking this is something different?

@ChristophHanck
Copy link
Author

Yes, something like this, so data varying over more than one dimension and the two (possibly more, although that is more rare in practice) indices to the variables reflecting that. Personally, I though of the plm package (https://cran.r-project.org/web/packages/plm/vignettes/A_plmPackage.html), but there are others around that have similar functionality.

@datalorax
Copy link
Owner

Could you possibly provide an example model along with what you would expect the output to look like?

@ChristophHanck
Copy link
Author

ChristophHanck commented Aug 12, 2021

library(plm)
library(equatiomatic)

data("Grunfeld", package="plm")
grun.fe <- plm(inv~value+capital, data = Grunfeld, model = "within")

might yield something like

$$
inv_{it}=\hat{\alpha}_i+\hat{\beta}1value{it}+\hat{\beta}2capital{it}
$$
(not sure why the subindices do not work in the output next to the betas and value and capital)

@datalorax
Copy link
Owner

Thanks, so it sounds like this is really about supporting a new model type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new model
Projects
No open projects
v0.2
To do
Development

No branches or pull requests

2 participants