Questions tagged [weighted-regression]

Weighted least squares regression is a generalization of OLS regression used when different data points have different importance, or "weights". See also [weighted-data].

Filter by
Sorted by
Tagged with
2 votes
1 answer
82 views

How do I calculate weights for weighted means?

I want the weighted mean of my dv, velocity. In this scenario, velocity is a derived/interpolated measure comprised of repeated measures of randomly sampled speeds in a given region. There will always ...
  • 173
2 votes
0 answers
39 views

What's the meaning of an increased SMD after inverse propensity weight matching?

I made an inverse propensity weight matching for my research project (two groups, treated and control) and after I observed for some covariates an increased standardized mean difference. What is its ...
0 votes
0 answers
35 views

Predicted y on IPW (Inverse Probability Weighted) logistic regression

I am performing a logistic regression where the original data has unbalanced classes, 5% 1s and 95% 0s. Using IPW (either by calculating the weights myself or by choosing class_weight='balanced' in ...
  • 63
0 votes
0 answers
9 views

How to apply weights to the the data of 1k sample to represent whole population when I am provided with weights?

Need help to understand: I have a citizen poll data that has entries about how people(male/female), age, employment status, education, country, opinion on current government, etc. now the company who ...
  • 1
2 votes
1 answer
63 views

Is there a way in R to include weights in a cox regression with Firth's penalized likelihood?

I am trying to fit a propensity score weighted cox regression model in R. However, one of the treatment groups has zero events, so I also need to use an adjustment method (Firth's penalized likelihood)...
4 votes
2 answers
57 views

Comparing weights in SPSS regression and R lm

In SPSS, you can use a variable as WLS Weight when carrying regression. In R, you can use a variable as an argument weight in <...
  • 463
0 votes
1 answer
178 views

What is the Matrix form of the prediction interval for Weighted Least Squares Regression

For ordinary least squares, I know the confidence interval is $\hat{Y} ± t\cdot\sqrt{\hat{\sigma}^2 * x_{new}(X^{\top}X)^{-1}x_{new}^{\top}}$ and $X$ is the design matrix, n is the number of ...
0 votes
0 answers
52 views

Combining standard errors of two separate variables

I have a dependent variable associated with a SE and an independent variable associated with a SE. I would like to weight my regression such that both of these SEs are taken into account. What is the ...
  • 41
0 votes
0 answers
14 views

Outputting the weighted version of a variable

Is it possible to apply weights to a variable (eg, the independent variable in a regression analysis) and then output the weighted version of this variable? I would like to weight both my dependent ...
  • 41
0 votes
0 answers
15 views

What does it mean when variables in in (probability) weighted regression are significant but variables in an unweighted regression are not?

I'm running to regressions. One with probability weights inputted and another one without. When running them, my results indicate that some unadjusted variables are insignificant, but those same ...
2 votes
1 answer
76 views

Fitting a Prentice-weighted PH Cox regression to case-cohort data and predicting scores based on new data

I am trying to fit a proportional hazards regression model to case-cohort data (where cases are oversampled and not representative of the population). I am using the Survival package and cch() ...
0 votes
0 answers
26 views

glmnet with weighted penalty

I need to fit a elastic net penalized logistic regression model in the form of Here W is a positive definite weight matrix. Since ...
  • 283
1 vote
0 answers
41 views

Survival analysis of a stratified case-cohort study in R

I am trying to perform a survival analysis for a stratified case-cohort study (1:2) where cases are patients with distant recurrence (DR) and the cohort is composed by patients without distant ...
1 vote
0 answers
21 views

Meta-regression for continuous data - effect size or otherwise?

I'm trying to parse the output of multiple studies to quantify how age impacts the prevalence of HPV in Europe. Thanks to an excellent suggestion in a previous question, it has been suggested that ...
  • 251
3 votes
1 answer
73 views

Is it possible to estimate IPTW in two different subgroups to evaluate interaction? (Subgroup Balancing Propensity Score?)

This questions needs a toy example to be explained. I apologize if the question is not clear. Suppose we have an observational study in which we want to evalute the association between exposure to ...
3 votes
2 answers
473 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 ...
0 votes
0 answers
19 views

Weighting the R-squared as a measure of goodness-of-fit in Linear Regression [duplicate]

I have two observed time series $x_i$ and $y_i$ and I want to test if $x_i$ is a good predictor of of $y_i$. So I run a simple linear regression Y ~ X and use $R^2$ as a measure of goodness of fit. ...
  • 1
1 vote
1 answer
156 views

Why Generalized Least Squares?

So it is often advise to use Generalized Least Squares when we have a regression model with non-spherical(i.e. heteroskedastic or autocorrelated) errors. We do so by doing a weighted regression $$ (y-...
  • 161
0 votes
0 answers
42 views

How to do weighted Total Least Squares (TLS, aka Orthogonal) Regression faster in R?

I am working on a problem where I am using orthogonal regression (aka Total Least Squares (TLS)). I originally used the odregress() function in R from the pracma package. However, it doesn't allow ...
1 vote
1 answer
72 views

Parallel with Weighted Least Squared in Bayesian Regression

I have a dataset with a column of ratios $Y = z_1 / z_2$, which will be my depending variable, and a set of columns that explain $Y$. Here $z_1$ means "imports" and $z_2$ means "exports&...
0 votes
0 answers
22 views

Weighted estimation

The following equation was derived from an optimization problem. I have data on the parameters $ b, v, n $ and $ r $ and I would like to estimate the parameter $ a $ that fits the data most closely. I ...
  • 21
0 votes
1 answer
68 views

Using WLS vs making the residuals homoscedastic to fit OLS regression

I'm convinced that homoscedasticity (of errors) is not an assumption (at least not explicit) for OLS regression. Also, even though WLS is advocated for heteroscedastic errors, OLS is not particularly ...
0 votes
0 answers
36 views

How to assign weights to a set of ordered objects?

I have been trying to assign weights to set of objects. The problem that I have is as following. I have a set of objects ordered either ascending or decending. . Each object shall be provided a weight ...
  • 103
0 votes
0 answers
53 views

R package for spatial regression

I want to model counts of a beetle (B) as a function of three continuous dependent variables (PC1, PC2, RL), weighted by a fourth variable (W) using either poisson or quasipoisson regression with ...
1 vote
0 answers
21 views

Comparability of variance estimation of residuals of WLS solutions

I have a linear regression model with $p$ parameters $$ y = X \beta + \varepsilon $$ and multiple datasets for the same model $y_i \in \mathbb{R}^N$ with known weights for each data point $w_i \in \...
  • 111
0 votes
0 answers
26 views

Determine feature importance of nested regression model

For remote sensing purposes, I'm trying to combine data from two different satellites. To do so, one of the two has a much higher weight than the other, but this is area specific. My goal is to use a ...
0 votes
1 answer
227 views

How to get glmnet to work for proportions as response variable

I am trying to run a penalized logistic regression in R. My response variables are proportions (they are winning percentages for a sports team), and I have the number of total games played by each ...
0 votes
0 answers
50 views

Regularization: How do you penalize weights of some exact value?

Assume we have a loss function of the form: L(f(X; theta),T) where X is the input dataset and T is the target dataset? Then you would update the the paramters by doing p = p - p.grad where p.grad is ...
1 vote
0 answers
83 views

Can I use GLM weights to model whether an outcome *ever* occurs, regardless of frequency?

I realized my original post was really two questions, so I'm splitting it up. My other post describes the same problem, and asks whether it can solved using a mixed effects model. My data include a ...
  • 143
0 votes
0 answers
14 views

Weighting for modelling probability of selection

I want to use inverse probability weighting in some regressions and to estimate some weighted means from a non-representative sample. I plan to estimate a probit model for probability of selection ...
  • 113
0 votes
1 answer
31 views

Calculating variance / standard errors for a Weighted Repeat Sales model

I'm writing an implementation of the Case-Shiller Real Estate Index, which is based on a variation of the weighted least squares, except for the introduction of a dummy matrix Z. I've calculated the ...
0 votes
0 answers
36 views

Deriving initial weights for IRLS in DESeq2's GLM model

DeSEQ2 is a frequently-used R package for researchers studying differential gene expression via changes in molecular markers such as Poly(A) RNA. Understanding how ...
  • 5,132
0 votes
0 answers
23 views

Weighted clustered standard errors

I am thinking about a weighted clustered standard error with heteroskedasticity. The estimate can be calculated as follows: \begin{equation} \begin{split} \hat{\beta} &= \left(\sum_g X_g'W_gX_g\...
  • 33
3 votes
1 answer
90 views

standard error in Weighted Least Squares in R

I am thinking of using a weighted least square method and checking the meaning of this approach. In particular, I am checking how the method in lm(., weights = w) ...
  • 33
0 votes
0 answers
18 views

Domain weights as hyperparameters

Suppose I have data from two different sources, $(X_1, y_1)$ and $(X_2, y_2)$, where $X_1$ and $X_2$ have the same variables but different distributions, and similarly for $y_1$ and $y_2$. I want to ...
  • 856
0 votes
0 answers
277 views

How to include standard error of input values in weighted linear regression?

In first step I have made linear regression for every array of 10 points for 25 devices as in the plot I get resistance R = 1/slope for every device and SE(standard error). Every 5 out of 25 devices ...
  • 1
0 votes
0 answers
20 views

Binomial GLM with Logit Link on Continuous Data given Frequency Weights [duplicate]

I'm wondering what R is doing in the background when given rate/proportion data and frequency weights. The Binomial GLM should only fit {0,1} data but the results still seem fairly accurate. Does it ...
2 votes
1 answer
31 views

Show condition so $\beta_{m+1}$ is the solution of weighted least squares problem

In my exercise we assume that $Y_i|X_i$ has distribution with density $f_i(y_i,\eta_i) $ for $i=1,...,n$ where $\eta_i=X_i^T$ is the linear predictor. The generalized linear model with an exponential ...
  • 273
0 votes
1 answer
125 views

Weighted linear regression coefficient without intercept's closed-form solution differs from R's lm(.., weights=)

I am working through Harold Larson's Introduction to Probability Theory and Statistical Inference. In Chapter 9, Example 9.1.4 he discusses the simple linear regression model but where we assume the ...
1 vote
0 answers
58 views

Weighted least square regression - different ways of estimating weights

Newbie here. I have a question regarding WLS regression. Specifically, I've come across different ways of estimating weights in WLS regression, the most frequent ones being: ...
  • 21
2 votes
1 answer
108 views

Degrees of freedom for calculating parameter covariance in weighted least squares

Wikipedia says the standard way to estimate the parameter covariance $M^\beta$ for weighted least squares (WLS) is $$ M^\beta = \chi_\nu^2 (X^TWX)^{-1} $$ with $$ \chi_\nu^2=\frac{r^TWr}{\nu} $$ and ...
  • 1,484
1 vote
0 answers
60 views

Differences between least-squares estimate and weighted least-squares estimate when I focus on only one coefficient in a multiple linear regression?

Suppose we have $n$ samples from the following linear model: $$y=x_1 \beta_1+x_2 \beta_2 + e,$$ where $e_i$ i.i.d. comes from $N(0,\sigma^2)$; $x_1$, $x_2$ are centralized with mean $0$. I am only ...
  • 95
0 votes
1 answer
162 views

Weights to use for a Weighted Least Squares model regarding tests/deaths

I'm currently doing an imaginary project where I'm investigating a possible correlation between the number of tests done for a specific disease and the number of deaths caused by said disease. I'm ...
1 vote
0 answers
148 views

Logistic regression for case-control studies

If I have designed a study where participants from 3 disease groups of fixed size were being sampled and suppose the three groups A, B and C are of sizes n_A=50, n_B=50 and n_C=100. Group A is a ...
  • 311
1 vote
1 answer
157 views

Can one compare Hazard Ratio and Average Hazard Ratio?

I would like to compare three predictors of survival by comparing three cox regression models. One model violates the PH assumption which brought me to weighted cox regression as implemented by ...
5 votes
1 answer
84 views

Least Squares Solution involving regularizer and weighted sum

I have come across the following cost function: $$ \text{min}_a\ \ (a^Tx^{(1)} -1)^2 + \sum_{j=1}^M \alpha_j (a^Tx_j^{(2)} +1)^2 + \frac{\lambda}{2}||a||^2 $$ This is a minimization over weight vector ...
  • 217
1 vote
1 answer
126 views

How to address twang package warnings in mnps function [closed]

I am using twang package as I have an analysis where I want to compare 3 categories and want to compute propensity scores to include as weights in the regression ...
1 vote
1 answer
63 views

Macro version of RMSE

I want to calculate the error of a prediction on an imbalanced dataset, i.e.: ...
  • 133
0 votes
1 answer
145 views

Weighted cox regression: test for goodness of fit?

I want to do a weighted Cox regression analysis (coxphw command in R) since there is violation of proportional hazards assumption in standard Cox model shown by Schoenfeld residuals. What would be the ...
  • 11
5 votes
1 answer
994 views

Iteratively Reweighted Least Squares - Weights Confusion

In performing Iteratively Reweighted Least Squares (IRLS) to derive $\hat{\beta}$ estimates for logistic regression, all the resource I've read online say to use weights inversely proportional to the ...
  • 625

1
2 3 4 5
7