Questions tagged [regression]

Techniques for analyzing the relationship between one (or more) "dependent" variables and "independent" variables.

23,365 questions
Filter by
Sorted by
Tagged with
194 views

145 views

Adjusting for age and gender in ANOVA

I am performing an ANOVA to compare the means of three groups. However, I need to adjust for the effects of age and gender in the ANOVA. I'm not quite sure how to go about it in R. Conventionally, I ...
2k views

Setting max_depth greater than the number of features in a Random Forest

I was using random forest regression to predict the price of a house. There are only 3 features in data set. Initially when I had set max_depth=2 the result was ...
137 views

Generalized least squares error estimation

First of all, I have to admit that I am not statistician so some of my nomenclature could not be very rigorous and maybe a bit confusing; pleas ask me to clarify if necessary. The Problem Let's say ...
124 views

Environmental variable vector in NMDS

I am using Non-metric MultiDimensional Scaling (NMDS) on a Bray-Curtis dissimilarity matrix. Then, I am trying to link the resulting NMDS axes (let's say "components") to environmental ...
7 views

R Library for Ordinal Regression with Split-Plot (Cluster?, Repeated Measures?) Structure

I have a data set with the following structure. The response is ordinal. There is an experimental factor (with two treatment levels, each treatment level applied to a different sample of subjects). ...
63k views

Why L1 norm for sparse models

I am reading the books about linear regression. There are some sentences about the L1 and L2 norm. I know them, just don't understand why L1 norm for sparse models. Can someone use give a simple ...
45 views

Econometrics meaning of structural versus regression model

I want to make sure my understanding is correct. Particularly in econometrics, when authors write down a model: $Y_i = \beta_0 + \beta_1 X_i + \epsilon$ Can I think of this as a 'structural model'- or ...
39 views

Appropriate goodness-of-fit test for the negative binomial regression

I have used the following Pearson $χ2$ test and the deviance test to assess the negative binomial regression using R as ######################################### ...
29 views

Including a weighting variable in a linear regression

I'm looking at how temperature affects length. My length variable is the mean length calculated for every year, it is derived from ~10,000 data points. Not every year had the same sampling effort (e.g....
9 views

Regression analysis before an optimization problem with an unkown function

I have data consisting of invested hours in different training seminars $T_{1},T_{2},...,T_{50}$ and the performance on an exam $P_{exam}$. Currently I know how much 1 hour of a training seminar costs ...
144 views

How to model a conditional probability without estimating joint PDF?

I've around 3e3 two-dimensional data points, x, d 1 1, 0.1 2 3, 0.1 3 2, 0.2 4 1, 0.5 range(x) = [-600, 600], range(d) = [0, 1] We are trying to model ...
6 views

What is the conditional variance of sample predictor on population predictor?

I am using the book introduction to Statistical learning with applications in R chapter 3. I've been able to find the conditional expectations, as well as the unconditional variance, but I've read ...
16 views

Fitting a multivariate linear regression with different residual variance for each outcome (using a mixed effects model in R)

In a small simulation, I am fitting a multivariate normal model to predict two outcomes Y1 and Y2, while also modelling the covariance between them. This can be done through a mixed effects model (...
132 views

Lasso and its dual: rates of regularisations

Let us consider the following lasso estimator: $$\hat{\beta}_{L} = \arg\min \, \frac{1}{n}\sum_{i}^{n}||y_{i} - \textbf{x}_{i}\beta||_{2}^{2} + \frac{\lambda_{n}}{n}\sum_{j=1}^{p}|\beta_{j}|$$ For ...
47k views

Why would anyone use KNN for regression?

From what I understand, we can only build a regression function that lies within the interval of the training data. For example (only one of the panels is necessary): How would I predict into the ...
6k views

Updating linear regression efficiently when adding observations and/or predictors in R

I would be interested in finding ways in R for efficiently updating a linear model when an observation or a predictor is added. biglm has an updating capability when adding observations, but my data ...
122 views

How to generate data that have given conditional mean and conditional quantile using R?

Suppose I want to generate independent data $(y_{i},x_{i})$ such that the conditional mean of $y_{i}$ given $x_{i}$ is a quadratic function in $x_{i}$ and the $.25$ conditional quantile of $y_{i}$ ...
15 views

Can a range of priors being used for a linear regression be applied to a logistic regression?

I have trial level data from a study in which participants responded to a series of stimuli. I have a predictor of interest. For the sake of this example, let's call it the size of the stimulus. There ...
2k views

Hidden state models vs. stateless models for time series regression

This is a quite generic question: assume I want to build a model to predict the next observation based on the previous $N$ observations ($N$ can be a parameter to optimize experimentally). So we ...
33 views

Assumption of linearity between variables and log odds in logistic regression

I know that in logistic regression we assume a linear relationship between the independent variables and the logits. Can you explain why is this a reasonable assumption?
8k views

What does linear stand for in linear regression?

In R, if I write lm(a ~ b + c + b*c) would this still be a linear regression? How to do other kinds of regression in R? I would appreciate any recommendation ...
141 views

How to achieve linear relationship between predictors and logit of outcome?

Prior to conducting a logistic regression of the 0/1 likelihood of a nest hatching or failing as a function of 9 continuous predictors, I plotted each of the standardized (mean = 0, SD = 1) predictors ...
14 views

Unstandardized estimated variance from regression

I am running a multivariate regression where both y1 and y2 are both predicted by x. For ...
13k views

Fitting models in R where coefficients are subject to linear restriction(s)?

How should I define a model formula in R, when one (or more) exact linear restrictions binding the coefficients is available. As an example, say that you know that b1 = 2*b0 in a simple linear ...
75 views

Homoscedasticity and independence of errors

In linear regression I often see homoscedasticity and independence of errors listed as assumptions (for example on wikipedia). But I would think that independence of errors would imply ...
47 views

How do I determine when a (non-independent) time series approaches a horizontal asymptote?

I have time series data with many data points per subject over time. I want to determine the marginal time interval within which my dependent variable (dv) falls within given "equivalence" ...
24 views

Adding a Dummy Variable to glm in R?

I'm running a glm in R with two categorical variables, one of which is binary, the other of which can take on five values. I would like it so that my model returns an intercept value that reflects the ...
1k views

Regression Lines With Same Intercept

So, I struggle with Regression a lot. I just found out how to get 2 lines with the same slope, but I cannot manage to get 2 lines with the same intercept. I read about ANCOVA a lot (because I thought ...