The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [linear-model]

Refers to any model where a random variable is related to one or more random variables by a function that is linear in a finite number of parameters.

1,579 questions
Filter by
Sorted by
Tagged with
237 views

Error in lda.default(x, grouping, …) : variable 74 appears to be constant within groups

I did a Linear Discriminant Analysis using R and the output given was Error in lda.default(x, grouping, ...) : variable 74 appears to be constant within groups. My codes are library(MASS) attach(...
75 views

Should I use a linear mixed model or a generalized mixed model?

I have a test dataset with repeated measures, different individuals sampled at different time points, here measured in days. I want to know if I should use a GLMM or a LMM to see how well, if at all, ...
17 views

Placing constraints on linear model coefficients

I have this bit of data : ...
26 views

Need of p-value adjustment when analyzing all possible pairs of factor levels in linear model

I have a nominal (not ordinal) variable with $K$ levels (these are actualy some groups of patients) and I run linear model in which: this nominal variable is one of IV's (others are age, sex and so ...
20 views

Combining regression models from separate data sets

What is the best way to combine regression betas from separate data sets? For example, a data set is split in two based on some fundamental characteristic, and the same two factor regression is run ...
13 views

Feature selection on full training set, does information leak if using Filter Based Feature Selection or Linear discriminate analysis?

In order to test a potential classification set, usually some data is kept as a holdout set, and not used for inner-cross-validation or model training. However, what happens if too many features ...
69 views

Bootstrapping with repeated measurements

I am trying to estimate a linear relation between body temperature and body mass, and I have a sample of measurements from subjects, with most subjects having one measurement, but several subjects ...
24 views

Is it common to maximize correlation between response variable and a combination of explanatory variables as a first model?

I am doing a linear regression project and in the exploration part I did something I was asked to explain in more detail... There are only 4 variables: 1 response variable and 3 explanatory variables. ...
52 views

In R (nlme/lme4), how do I compare two linear models with different sample sizes and different groups? [duplicate]

First off, I have a dataset with sparse longitudinal data. There are 30 individuals with 1 sample, 30 individuals with 2 samples, and 5 individuals with 3 samples. Various categorical variables are ...
13 views

Monthly data vs aggregating weekly data to monthly in linear regression

Let's suppose I have weekly data available for making a forecast using a linear regression model. Let's also assume that the weekly forecasts can be aggregated to monthly ones. Would it make sense to ...
54 views

Understanding simplification of constants in derivation of variance of regression coefficient

In looking over TooTone's answer in Derive Variance of regression coefficient in simple linear regression, there's a step in line 3 below where $(\beta_0 + \beta_1x_i + u_i )$ is simplified to $u_i$ ...
11 views

An Interesting Model with Unknown Orthogonal Design Matrix

Consider a linear mixed model, $$\mathbf{y}_{ij}=\mathbf{\Gamma}\mathbf{\mu}+\mathbf{z}_i+\mathbf{e}_{ij}, ~~ ~~i=1,\ldots,m,~~j=1,\ldots,n_i,$$ where $\mathbf{y}_{ij}$ are $k\times 1$ observation ...
84 views

Understanding cov.reduce argument in emmeans function

I would appreciate any help regarding emmeans package. I am fitting dummy-variable regression model (ANCOVA) with follow-up post hoc test in ...
12 views

32 views

Handling Missing Values in the context of Time Series Data

I'm doing a study on one dataset that contains 70 financial ratios for all U.S. companies across eight different categories (Valuation, Liquidity, Profitability, and etc) from 1970 to 2018 monthly. ...
28 views

Removing intercept from linear regression model [closed]

anyone knows how can i remove the intercept of my model while performing cross-validation? I have already tried using "-1" or "+0" in my formula but nothing. As you can see on my script my R2 is too ...
94 views

Winsorizing data in small sample

I have a relatively small sample of panel data (quarterly data for 68 firms over 7 years). My dependent variable is positively skewed. In order to limit the influence of observations with large values,...