New answers tagged

4

Indeed a paired $t$-test is equivalent to a linear mixed model that you formulated as $Y_{ij} = β_0 + β_1t + a_i + ε_{ij}; \\a_i ∼ N(0, σ^2_{subject}), ~ε_{ij} ∼ N(0, σ^2_{res}); \\i=1,2,...,n; j=1,2;$ where $i$ indices the subjects and $j$ codes the two paired conditions. why wouldn't it make sense to include a random slope? The dummy variable $t$ ...


3

The dataset under consideration is a dataset for $i=1,...,I$ municipalities for $t=1,...,T$ time periods. The model to be estimated is $$ y_{it} = \mathbf x_{it}^\top \beta + \delta_t + \phi_r + \psi_{rt} + \epsilon_{it},$$ where $\delta_t$ is time fixed effect, $\phi_r$ is the region fixed effect and $\psi_{rt}$ is region-time. To estimate this model ...


1

You can include dummies (binary variables that are either 1 or 0) for each year, for each region, and also year times region interaction dummies in your model. So you might have a dummy for year 2019, another dummy for Northeast region, and then a dummy that is 1 for Northeastern region municipalities in 2019, and so on. There are more computationally ...


0

First differences is more appropiated when the errors are serial correlated, whereas fixed effects is better in the other case.


-1

The intercept should almost always be included, that is, if you do not include, you should know why. Specific reasons and discussion can be found in the similar question When is it ok to remove the intercept in a linear regression model?, which is almost a duplicate. In comments is mentioned the case of a categorical predictor for $k$ groups, with all $k$ ...


0

You needa tweak the regex in names_pattern and pivot wide again: pivot_longer(df,-c(subject,treatment,x_baseline,y_baseline), names_to = c("measure", "type"),names_pattern = "([^_]*)_(.*)") %>% pivot_wider(names_from="measure",values_from="value") subject treatment x_baseline y_baseline type x y <int> <fct> ...


0

You can get them to match up by either Dropping the intercept from the FD model. Add a linear time trend to the FE model The FD intercept corresponds to the linear time trend coefficient in levels, which you can see here: $$y_{i,2}-y_{i,1}=\alpha_i-\alpha_i + \beta\cdot (x_{i,2}-x_{i,1})+\gamma \cdot (2-1)+\varepsilon_{i,2}-\varepsilon_{i,1}$$


1

You correctly note that fixed effects (FE) and first-differences (FD) should be similar when $T = 2$. The slight difference you are observing is due to the estimation of the intercept in an FD equation. The intercept usually drops out after differencing. In some contexts, you might want to estimate a time trend, even in a two period case; the intercept is ...


0

What you have at hand is panel data ; fixed effect Poisson models is well understood* and can be easily applied in many statistical software. For Stata see xtpoisson ; for R, it seems that glmer() in the lme4 package with family=Poisson do it** ; or the fixest packages***. *: https://en.wikipedia.org/wiki/Fixed-effect_Poisson_model **: https://www.stata....


5

1) No, this is not an appropriate way to estimate the time to an event. Imagine you changed your scale from weeks to days, or seconds. You would automatically inflate how much data you have, and so the estimated probability would tend to zero. Your outcome shouldn't change based on what scale you measure it on in this way. Tools from survival analysis are ...


0

You're on the right track. You're estimating a linear probability model (LPM) using panel data. [I]n the past when I've done some regression analysis, when the independent variable (Y) is a log, it's possible to say that an increase in one unit of a dependent variable (X) leads to a % increase in Y. Not quite. You are confusing $X$ and $Y$. I'm sure this ...


0

Hi you can train in self supervised way your 4D time series. You can use a convolutionnal network you will have 4 inputs channels. You will use then a MSE loss between your input let's says last 2048 points and prediction set at the 256 points for example. In order to achieve a good accuracy you can train a convolutionnal VAE autoencodeur and use the ...


2

Consider the case of a simple linear regression using panel data. So, for example, assume we are trying to figure out how age and education affect individuals' income. Also, forget the whole log-linear regression part. To keep this simple, I'm just going to use a simple linear regression. In essence, I want to find the coefficients for the following equation:...


0

Group is a factor. So, so called 'reference level' is chosen for it (by default this would be its first level: Group1). All the coefficients of the model can be interpreted as a difference between 'modelled' and 'reference' level. So, in you case: (Intercept) is parameter for Group1, so Y is on average equal 0.30604 for subject in Group1 in TP=0 Y is ...


1

Dynamic Time Warping might be a good choice if you are explicitly trying to use one time series to predict another. This method works by means of determining similarity between two sequences which vary, typically in either time or speed. From looking at your time series, it would not appear (at least visually) that there is a lag between the two time ...


0

I am not a proponent of standardizing coefficients in panel data contexts. But, hopefully others will offer their input. Is it [okay] to standardize only the dependent and independent variable? You can, but what is your justification for doing this? For instance, you already noted that you intend to demean your data. By construction, you are restricting ...


2

If you have measurements before and after some treatment, you have repeated measures. These are correlated to one another and thus violate the assumption of independent measurements. This means that neither of the models you have run produce valid standard errors. Using a linear mixed effects model, you can account for the dependence between measurements of ...


Top 50 recent answers are included