Questions tagged [regression]

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

Filter by
Sorted by
Tagged with
3 votes
0 answers
33 views

Ridge Regression Alpha/Lambda: Basic Characteristics?

I fear this is an ill-posed question that has been asked a million times, but what are the basic characteristics of the penalty multiplier (usually called $\lambda$ or $\alpha$) in Ridge Regression (...
user avatar
0 votes
0 answers
10 views

How to compare return percentages of products in different lifecycles?

For my project, I am trying to predict return ( when a product in ecommerce sale is returned) rate of products. For the same of simplicity, assume I have 3 static features (dont change in time) and ...
user avatar
  • 1
1 vote
0 answers
15 views

How to compute minimum sample size of a simple linear regression model with given statistics values

Suppose the statistics values are given as follows: $\sum_{i=1}^{n}x_i, \sum_{i=1}^{n}y_i, \sum_{i=1}^{n}x_iy_i, \sum_{i=1}^{n}x_i^2,\sum_{i=1}^{n}y_i^2$ Firstly, we can compute the regression ...
user avatar
  • 11
0 votes
0 answers
17 views

Is there a certain method to communicate the results of earnings without logging the variable?

I am investigating whether earnings differences have widened between different social classes in several European countries by comparing two different periods. The picture below shows the findings of ...
user avatar
  • 197
2 votes
1 answer
81 views

Multinomial logistic regression R vs Python

Does anybody have experience with the SKlearn multinomial regression (model = linear_model.LogisticRegression())? My data looks like this: ...
user avatar
  • 227
0 votes
1 answer
65 views

Logistics model on variable with values 1, 2, 3?

I have a dataset containing traffic crash information. One variable in the set is the number of fatalities that resulted in the crash, which has the values 0, 1, 2, and 3. I am working in R and want ...
user avatar
1 vote
0 answers
17 views

LME Quantifying differences between and within intervention groups

I am new to mixed-effects models and trying to ensure I understand them appropriately. I am analysing the results of a 2x2 cross-over intervention study. Essentially, I have 50 subjects who completed ...
user avatar
  • 11
0 votes
0 answers
4 views

plm/fixed effects models: fixef function error - wrong effect argument

I am using the plm function to analyze a large dataset with 120,000 IDs over three years. My specification looks the following: ...
user avatar
  • 11
0 votes
0 answers
32 views

What could cause regression linear models to predict exactly the mean of train set while random forests perform worse?

Data set: I'm working on a linear regression problem where my train set $X$ is of shape $(703 557, 53)$. Each row is a client's features, which could be its age, its gender, how many calls we received ...
user avatar
  • 155
0 votes
0 answers
16 views

Testing equality of coefficients from two different samples

I have the regression statistics for the same regression run on two different samples, and am asked to explain whether it is possible to test for equality of the coefficents, $\beta_1$and $\beta_2$ ...
user avatar
0 votes
0 answers
11 views

Interpreting Predictions from the Log-Linear Model (or Log-Log Model...)

I understand that when we fit an OLS regression to the log(y) (as either a log-linear or log-log model), the predicted value from that model [log(y).hat] cannot be simply exponentiated to solve for y....
user avatar
  • 65
0 votes
1 answer
27 views

How to select predictor variables for linear mixed model?

I have a linear mixed model with ~30 clinical/treatment variables and repeated outcome variables for patients. E.g. The outcome variable is Breast symptom scores, which were collected at different ...
user avatar
0 votes
1 answer
23 views

What is the intercept in a regression model with demeaned dependent variable?

Suppose you have a regression model $\tilde{y}$ = $X\beta$ + $\varepsilon$, where $\tilde{y}$ = $y$ - $\bar{y}$ and $X$ contains a constant. If you estimate the model by OLS, does the estimated ...
user avatar
2 votes
3 answers
615 views

Negative prediction values from linear regression in R

So I made a linear regression in R Studio to predict the price of a car based on the year of fabrication. The data set is called "audi" and my linear regression looks like this: ...
user avatar
0 votes
0 answers
11 views

Potential direct effect of moderator on independent variable [duplicate]

I am looking at the effect of a moderator variable (MV) on the association between my independent variable (IV) and my dependent variable (DV). I have now come across a theoretical paper which ...
user avatar
2 votes
2 answers
57 views

IPTW in Cox Regression model using the WeightIt package - Question on ATT vs. ATE interpretation

I am currently trying to perform some IPTW adjustment in the context of Cox Regression models. I was interested in expanding my understanding of the differences between ATE vs. ATT estimation. I've ...
user avatar
2 votes
0 answers
42 views

Is there a fundamental mathematical reason that ordered factors are represented as orthogonal polynomials in linear regression?

At least for R, Chambers/Hastie write in their book "Statistical Models in S" in chapter 2.3.2 "Coding Factors by Contrasts": Ordered factors are coded so that individual ...
user avatar
  • 139
1 vote
3 answers
57 views

Regression with 'stacked' data

I've occasionally seen people do something like the following. Let's say we have a survey battery with k questions, for instance an evaluation of red jelly beans, an evaluation of green jelly beans, ...
user avatar
  • 113
0 votes
0 answers
22 views

NumPyro: sampling active sites as Bernoulli RVs [closed]

Consider the following Bayesian regression model: $ \begin{align} \begin{split} \alpha&, \beta, p, \sigma \in \mathbb{R}_+ && \text{(known, fixed)}\\ X &\in \mathbb{R}_{+}^{m \times n} ...
user avatar
  • 2,376
1 vote
1 answer
20 views

Testing whether replicate number has an effect on outcome

I have four biological (independent) replicates in each of my experimental conditions. There is a potential issue with our equipment - it's possible that the first replicate for each condition is ...
user avatar
  • 11
0 votes
0 answers
14 views

Effect of size of data on the confidence on the coefficients in Linear regression? [duplicate]

What is the impact of size data on the confidence (p-value) of model coefficients?. Does increasing the size of data always improve the confidence in the model coefficients? Suppose I have 100 data ...
user avatar
0 votes
0 answers
10 views

How do you calculate $R^2$ from $F^2$? And how do you calculate $SR^2$ (linear regression)

Here's my dilemma (I'm new to this, so please try to keep it relatively simple if you can): I want to do a sensitivity analysis and calculate what my model (2 predictors) has a power of .95 for ...
user avatar
0 votes
0 answers
49 views

how to calculate regression between multiple variables simultaneously

Assume a system composed of $n$ (unknown) linear functions $f_i(x)=a_ix+b_i$. A sample of the system is a tuple ($c_1$,...,$c_n$) s.t. $c_i=f_i(x)+e_i(x)$ for a constant (unknown) $x$ and some error ...
user avatar
0 votes
1 answer
25 views

When having non-proportional hazards, should I use stratified Cox by time or Logrank tests within periods?

My data have non-proportional hazards with clear separation. Should I handle it via stratified Cox regression or using separate Log-rank test within subsets? I will use R only to illustrate. I want to ...
user avatar
1 vote
1 answer
58 views

Best practice for Post-Double Selection LASSO (pdslasso)

I'd like to have a clearer idea of the optimal approach to the post-double selection LASSO (paper, webpage). Take data on an RCT with 2 treatment arm dummies $D_1, D_2$ and a potential driver of ...
user avatar
  • 15
2 votes
1 answer
15 views

When computing period-specific hazard ratio using Cox, should I add variable:strata or full variable * strata?

Let's asusme I want to calculate separate hazards ratio in two periods, split like below. ...
user avatar
0 votes
0 answers
16 views

Time series data in regression analysis

I'm making a regression analysis in Python to find out the dependence between the stock price and several variables : my dependent variable - share price of company, independent variables - price of ...
user avatar
  • 1
0 votes
0 answers
30 views

With Stationarity How can ARMA Modelling have any Validity?

I have recently been thrown into the deep end with time-series econometrics. The first thing I have learned is that in order to avoid the spurious correlation trap, I need to ensure that all the ...
user avatar
0 votes
0 answers
6 views

Is there a way to calculate prediction intervals for decision tree or extra trees regression models?

I only see examples of prediction intervals for random forest and linear regressions but do not see much about ensemble models. I'm not sure if my understanding about prediction intervals is correct. ...
user avatar
0 votes
1 answer
36 views

Regression analysis with time series data

I'm completely stuck. I'm making a regression analysis in Python : my dependent variable - share price of company, independent variables - price of steel, price of coal and changing in local currency. ...
user avatar
  • 1
1 vote
0 answers
41 views

Logistic regression: variable coefficient is statistically significant but not statistically significant as an exponentiated odds ratio? [closed]

As mentioned in the title. I came across this instance using GLM in R. Is this an error? EDIT: The p-value of the coefficient was calculated by GLM in R and is less than 0.05. I then plotted the odds ...
user avatar
  • 41
1 vote
1 answer
36 views

Why is a random forest regressor better than a random forest classifier when predicting a category?

I am building a model that recommends the optimal golf club based on data I have gathered. Since the model prediction should be a category, ie. a golf club, I would assume I would have to use a ...
user avatar
0 votes
0 answers
30 views

Lspline and bs produce very different coefficients for linear splines - which is preferred?

In the vignette for the lspline package in R it says that the package computes Linear splines with convenient parametrisations ...
user avatar
0 votes
1 answer
64 views

Choice Between Alternatives in Machine Learning

I need some advice on the simplest/best way to structure an ML model for a (slightly) non-standard situation. Setup: I have many teams in a company that have leaders. Each team has two options for a ...
user avatar
1 vote
1 answer
25 views

Can MARS regression be used for classification?

I am dealing with a data set in which I have to classify between a diseased and a non-diseased individual. I was wondering if it is possible to adapt the MARS regression (Multivariate adaptive ...
user avatar
1 vote
2 answers
57 views

Unintuitive results in model comparison

I am running an experiment for some time now and currently I am in the process of analyzing my data. At first I was unsure about which model fits my needs, but after receiving some much appreciated ...
user avatar
  • 23
0 votes
0 answers
17 views

Year-specific fixed-effects model in R

Does someone know, how I can translate this formula of fixed-effects in R? Here is the explanation of the single variables: Thank you in advance!
user avatar
  • 11
1 vote
0 answers
18 views

Best way to compare income of two groups of people over time

I am planning a research study where, among other things, I want to understand how an intervention changes income in two groups. I plan to collect income data from each individual at three time points....
user avatar
  • 45
3 votes
2 answers
96 views

Interaction terms and causal interpretation

I'm estimating the following model: $Y_{i,t} = \alpha_{0} + \alpha_{1}X^{1}_{i,t} + \alpha_{2}*T_{t} + \alpha_{3}X^{1}_{i,t}*T_{t} $ In which $T_{t}$ is the year treated as a continuous variable, tend ...
user avatar
0 votes
0 answers
13 views

What is the meaning of the inner product between two regression variables?

I have been analyzing the effect of design matrix columns on the contour line of the least squares regression. These contours obviously are ellipses when only two columns $\phi_1$ and $\phi_2$ are ...
user avatar
  • 11
0 votes
1 answer
25 views

Correlations between variables based on gender in R

I have a data set in which female is coded as 0 and male as 1 and then I have different testing scores; writing, reading, math. I want to determine whether the correlation between math and writing ...
user avatar
  • 11
2 votes
1 answer
22 views

Logistic regression - One model trained on different groups

I have a logistic regression model that trains a set of binary independent variables (X) on a binary response variable (Y). The data was gathered from different individuals for who also e.g. socio-...
user avatar
  • 121
0 votes
0 answers
20 views

Fitting models to test revenue performance

I have a dataset containing different survey models and their participant score. When a participant scores, we have a value 1 and 0 otherwise. Therefore, we have a binary classification for each model....
user avatar
0 votes
0 answers
11 views

Alpha and Interaction Term in a Fixed Effects Model

I am trying to replicate a study - I pasted the text of one of their models below. I get results in R with a long format. However, it seems like I don't understand fixed effects models enough to ...
user avatar
  • 11
0 votes
0 answers
18 views

Relationship between normally distributed errors (bivariate OLS regression) and bivariate normality of variables (Pearson’s r)

I have forty quite diverse statistical text books at hand but I cannot find a reliable answer. I’ve studied the following and associated threads, but they didn’t got into it that deep: here and here. ...
user avatar
1 vote
1 answer
10 views

How to test differences of three categories within the same individuals?

Suppose I can observe $Y_{ijt}$, $i = 1,2,..., n$ , $j = 1,2,3$ and $t = $ 3 weeks, 1 months, half a year and one year. I am interested in whether $E(Y|j=1,k) = E(Y|j = 2,k)= E(Y|j=3,k)$ $E(Y|j, k) ...
user avatar
  • 599
0 votes
0 answers
19 views

How to test whether a factor differs from 50%, and which levels within the factor differ from 50%?

I have a categorical factor with 100 levels and 100 different proportions. I would like to test (a) whether these proportions differ from 50%, and (b) if any of the levels in particular differ more ...
user avatar
  • 309
1 vote
0 answers
26 views

Distribution-free prediction intervals in linear regression

I've found some literature on the subject, but it is rather difficult to read. I am wondering if the following simplified method makes sense. My question is what part is correct in this methodology, ...
user avatar
0 votes
0 answers
13 views

Adjusting for baseline when time is a covariate, what is the interpretation of $y(t=0)$?

When one aims to estimate the treatment effect over time, it is recommended to include the baseline value as a covariate. Assume continuous outcome $y$, continuous time $t$, categorical treatment $x \...
user avatar
  • 1,552
0 votes
0 answers
8 views

Biased, linear MMSE estimator from biased measurement data?

I am trying to find out if what I am looking at is a known problem. I am considering the case of weighted least squares, and I am trying to find the optimal weights of biased measurements. I have ...
user avatar
  • 101