Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

"Weights" may refer to: (1) observation weights that come from sample surveys -- consider tagging "survey-sampling"; (2) Monte Carlo sample weights that arise when sampling from intractable distributions -- consider tagging "weighted-sampling"; (3) variable weights in statistical or machine learning ...

2
votes
2answers
33 views

How to find the weight of the weighted least squares regression analysis?

As the title, I am having trouble to the find weight at the weighted least squares estimation. I found that some people use weights like wts <- 1/fitted(lm(abs(residuals(regmodel.1)) ~ x))^2 or ...
0
votes
0answers
12 views

Weights of ratio of weighted data

Suppose I have the two datasets $x_i$ and $y_i$ with weights $w_{x,i}$ and $w_{y,i}$, respectively ($1 \le i \le N$). The weighted means are for example: $$\bar x = \frac{\sum_i x_i w_{x,i}}{\sum_i ...
2
votes
2answers
88 views

Which weighting to use for regression analyses at different levels of aggregation

I run a study with subjects in 400 groups of heterogeneous sizes ranging from 2 to 20 individuals. I have outcome data at the group level and at the individual level. Treatment was randomly assigned ...
1
vote
2answers
37 views

Reweighting features in PAM/K-means clustering

As stated in Hennig et al. 2016 Handbook of cluster analysis: If for subject matter reasons some variables are more important than others regardless of the within-variable variation, one could ...
1
vote
0answers
18 views

Formulating the Netwon Raphson

If this is the dataset under consideration and ...
0
votes
0answers
21 views

Regression with varying weights within fixed effect units

I'm running a regression where within the fixed effect groups, the weights are not constant. However, since there are many fixed effects, I would like to use an estimation method as implemented for ...
1
vote
0answers
42 views

Adding weights to forest plot with subgroups

I am creating a forest plot with subgroups (roughly following this example). Now I want each subgroups to be weighted as if I would plot them individually in a separate forest plot, and the weights ...
0
votes
0answers
29 views

Interpreting weighted MLE, MoM estimates with stochastic weights

I deal with the weighted probability density $h(x)=w*f(x, \theta)$, where x is the stochastic variable, f is the unweighted probability density, w is stochastic weight depending on x and also measured ...
0
votes
0answers
28 views

lmer in R: How and when apply weights to factor with 3 levels and unbalanced case numbers?

I want to run a mixed effects regression with lmer (package lme4) in R, predicting reaction ...
3
votes
1answer
41 views

Are frequency weights and sampling weights, in practice, the same thing?

Frequency weights indicate how many cases in the population a given observation represents. Sampling weights indicate the probability (sometimes the inverse of the probability) of an observation ...
0
votes
0answers
28 views

Weights vs offsets in logistic tree models

I'm interested in the differences in interpretation and functionality regarding weights and offsets in logistic regression trees. In my case, I am using XGBoost trees for logistic regression where the ...
0
votes
0answers
9 views

make weighted adjustment for sample selection bias

I have a survey results data which is know as biased. Each row record the age, education and ethnicity. I also I have census summary for the national population. So I know the basic results of ...
2
votes
1answer
28 views

How to compute adjustment weights to match marginal sums of a matrix?

I have a feeling this should be very simple, but I somehow got stuck thinking about it. I have $\it X$, which is a 15 x 18 matrix containing non-negative real values. I smoothed this matrix using a ...
2
votes
1answer
36 views

Can I use combination of eigenvectors as a single vector to explain most of variance?

I have a problem trying to find a combination (or weighted average) of variables (statistics) that best explains the sample statistics. A – n x p matrix (n: observations p: variables, here are ...
1
vote
0answers
32 views

Inverse weighted average

Is there something like an "inverse weighted average"? In my case, I have daily prices and daily units sold of a bunch of products and I would like to give prices with more units higher weights than ...
2
votes
1answer
25 views

Standard deviation of a ratio and calculation of weight

I have several "skilled" and "unskilled" wage observations for a number of countries, and would like to construct a single skilled-unskilled wage premium by country as the ratio of the simple average ...
0
votes
0answers
40 views

Can I compare coefficient values from different models?

I'm modeling conversions with a logistic regression. Each conversion can have up to 3 events (page visit, fill questionnaire, and call). I have 3 domains let's call them A,B, and C. Rather than using ...
0
votes
0answers
13 views

Final model equation for logistic regression with weights

I have built a logistic regression model with weights using glm function in R, as the event was rare. I used all 1's and 10% of 0's, then assigned a weight of 10 to each of the 0- rows and no weight (...
1
vote
0answers
5 views

What weight and how to use it for a 3 country analysis using the EWCS in Stata?

I'm fairly new to weights because the databases I used previously were not samples but actual populations I wanted to study, so apologies if all of this sounds very noobish. The way I understand it, ...
2
votes
0answers
102 views

Diagnostic residuals for Beta GLMM weighted by sample size (Meta-analysis) using glmmTMB

I am conducting a GLMM for a meta-analysis using the beta distribution with the package glmmTMB. My response variable is a vector of correlations (No exact 0 or 1), but Fisher’s transformation fails ...
0
votes
1answer
29 views

How to interpret the sampling weight of each observation in the dataset? [closed]

I have a data set containing a sampling weight for each observation. Here are the top observations from the data set : My question is what does this sampling (survey) weight means? How to interpret ...
1
vote
0answers
16 views

Can analytic weights be converted into sampling weights?

I am running a linear probability model, so I know I need to correct for heteroskedasticity. Since I know the variance of the error (from theory) to be $y(\pmb x)(1-y(\pmb x))$ where $y$ is the ...
0
votes
0answers
61 views

Weight minority classes using XGBoost (Multiclass)

I'm dealing with a multiclass problem in R using XGBoost. The dataset has 3 Classes representing the following proportion: 20% - 75% - 5%. Given the description above, it would be awesome some tips ...
0
votes
1answer
132 views

How to change a weight/bias with gradient

After watching 3Blue1Brown's tutorial series, and an array of others, I'm attempting to make my own neural network from scratch. So far, I'm able to calculate the gradient for each of the weights and ...
1
vote
0answers
9 views

Find a cost-sensitive multiclass algorithm

I am working on decision trees which can directly work in a multiclass context. My aim is reduce the misclassification's errors of a decision tree by improving its ability to tackle imbalanced ...
0
votes
1answer
56 views

How to use Tukey's Biweight Function to appropriately weight outliers to generate a normal distribution

I am working with a distribution that has outliers beyond 1.5*3rd Qu.. I'm using Shankar, et al. Recommendations for the validation of immunoassays used for ...
1
vote
0answers
14 views

What is the effect of more than one chance of selection when sampling?

I am designing a clustered sample. Within each cluster there are 3 groups that will be sampled from - two at a higher rate than the other. The two subgroups that will be sampled at a higher rate are ...
0
votes
1answer
36 views

Free lunch Autoencoder? Data dimensionality reduction

I came across Autoencoders, and saw one example were no activation is used - it's simply a linear transform to lower dimension and then back up $$ B(Ax+a)+b=x$$ with $x\in \mathbb{R}^d$ and $A\in \...
0
votes
0answers
26 views

Weighting covariates in a regression

Sometimes I hear about people talk about how this or that covariate or feature is "weighted" in a predictive model, but I can't find an easy mechanism to do that in ...
1
vote
0answers
34 views

How to weigh samples (representative of population) when comparing group means

I want to clarify my understanding of using sample weights when comparing means of sub-groups of a sample. Here is an artificial case with data that can be replicated in r (see code below): Let’s ...
0
votes
0answers
52 views

Weighted least squares: how do I find weights

I have a dataset of the cars and their corresponding speed and distance and the R output. I am asked to find weights for the first 2 cars. First I find the residual for each car: $e_i=Y_i-\hat{Y}_i$ ...
5
votes
1answer
1k views

A simple Neural Network, finding weights to achieve 100% accuracy

So I've been watching lectures and doing the problem sheets from the class CS 229 2017, taught at Stanford by Andrew Ng. In problem sheet 3 he puts forward the following question: $\textbf{So this is ...
0
votes
0answers
19 views

Finding weights and y-values in multiple linear regression?

Suppose I have observations from 15 hospitals that show its expenses, number of services offered, number of employees and the reciprocal of its average rank. I want to use these 4 independent ...
2
votes
1answer
94 views

Is a weighted average unambiguously superior to an unweighted average?

I want to describe a statistic on my data. For example, I have data on firms (companies), and I have a measure of $x$ for each of them. Now, firms differ in size, which could be understood in terms of ...
1
vote
0answers
46 views

Equivalence of svyglm and glm for simple random surveys

I have been exploring the use of the svyglm function in R's survey package to analyse surveys with both equal and unequal sampling probabilites. For an unequal ...
1
vote
0answers
28 views

How to generate weights for non-response?

We would like to use probability weighting to account for non-response in a survey of risk factors for a disease. The fraction of those we approached who refused the survey is very high. Because of ...
0
votes
0answers
29 views

Logistic regression: calculate likelihood value for training data set using weights

I want to: calculate a logistic regression model using a training data set calculate predicted probabilities for a test data set assess the fit of the predictions to the actual values in the test ...
0
votes
0answers
57 views

Weighted McNemar's test?

I have weighted, paired survey data. I am running a weighted t-test for the numeric data (using the wtd.t.test R function), but looking for a weighted McNemar-type test to run on the binary data. I ...
1
vote
0answers
18 views

Scaling weights in multi attribute decisions

I have a set of attributes that make up a feature (e.g 'Accommodation' in the sample below), each attribute has a weight range specific to the feature as per the picture. The intention is to have ...
4
votes
2answers
156 views

Regularization on weights without bias

I was learning neural network using the book "Deep Learning" by Ian Goodfellow, Yoshua Bengio and Aaron Courville. In section 7.1, it says: ...we typically choose to use a parameter norm penalty Ω ...
0
votes
1answer
59 views

Correcting an unnormalized posterior for the weighting of the prior

Bayes' rule tells us that, $P(h|d) = \frac{ P(d|h) P(h) }{ \sum_i P(d|h_i) P(h_i) }$. Let's say we have four hypotheses: $h_1$, $h_2$, $h_3$, and $h_4$. The likelihood over hypotheses looks like ...
0
votes
2answers
136 views

Are weights 1-D or 2-D in softmax Regression?

I've learned ML and have been learning DL from Andrew Ng's coursera courses, and every time he talks about a linear classifier, the weights are just a 1-D vector. Even during the assignments, when we ...
0
votes
1answer
112 views

How does the XOR neural net work? [closed]

I'm new to neural nets, and I'm having a hard time wrapping my head around the concept of weights and whatnot. I've been staring at a diagram of the XOR neural network for an hour, and I genuinely ...
2
votes
0answers
68 views

Combine Difference-in-Differences Design with Entropy Matching

I have a pre-post/treatment-control design (diff-in-diff) with one treatment event. The data is a firm panel data set (5 pre and 5 post firm-years, ~200 firms). The problem - my treatment and control ...
0
votes
1answer
62 views

gamma mixed model with offset and/or weights

I have some continuous positive data $Y_{ij}$ representing accumulated quantities, where $i$ denotes subject and $j$ a state. Patients are transitioning across states sequentially, but not all ...
7
votes
1answer
493 views

Ordinary kriging example step by step?

I have followed tutorials online for spatial kriging with both geoR and gstat (and also ...
2
votes
2answers
263 views

Accounting for uncertainty in a mixed-effects regression

I have calculated an effect size along a dataset of experiments distributed worldwide through a mixed-effects meta-regression. The effect size in the dataset depends on climate (y ~ temperature + ...
0
votes
1answer
55 views

Should I use weighted average to deal with category size problems in a logistic regression?

I am trying to see the effect of retirement benefits on the late-career intentions for business. The retired employees are categorized on the basis of retirement benefits. The first category is low, ...
0
votes
0answers
12 views

How to develop a weighted rating scale?

I am trying to prepare a questionnaire of 30 items in order to assess the quality of published papers. Based on the importance of each criterion, I want to assign weights. Should I assign the weights ...
1
vote
0answers
50 views

How to estimate confidence interval for weighted correlation

It is my understanding that the confidence interval for a Pearson correlation is asymmetric. (Confidence interval for correlation, for example.) r’s command ...