Questions tagged [weighting]
81 questions
1
vote
0 answers
Stacking multiple design terms using survey package in R
I am trying to understand how to combine several designs using the survey package in R.
For example, to construct survey weights, I need to post-stratify, calibrate, trim weights, and re-calibrate.
I have tried to stack the design terms in the…

Shiyu Zhang
- 11
- 1
1
vote
1 answer
How to compute a weighted ranking score?
Given the output of a ranking question:
df <- structure(list(rank1 = c("A", "NA", "C", "B", "A"), rank2 = c("B",
"NA", "A", "A", "B"), rank3 = c("C", "NA", "B", "C", "NA"), rank4 = c("D",
"NA", "E", "D", "NA"), rank5 = c("E", "NA", "D", "E",…

Caro
- 25
- 3
1
vote
1 answer
How can I weight a column with a number, R?
I have a column with anomaly values and I want to weight it with a specific number representing the number of years (32).
How can I do this?
data(mtcars)
mtcars$weight<-apply(mtcars[5], 1, ??, 32)

foo
- 33
- 6
1
vote
1 answer
How to create a new array of set length from multiple arrays of varying length, the number of items taken from each smaller arrays based on importance
I want to pull 'questions' from different 'topic' arrays to build a quiz. The topics are being selected in order of importance to the user, each topic with a varying number of questions within and are used to populate a 20 question quiz's question…

Kevin Brennan
- 51
- 5
1
vote
1 answer
How can I incorporate sampling weights into an analysis of Likert scale survey questions?
I am analysing survey data, whose questions are in the form of the Likert Scale. I used auxiliary census data to calculate weights for different age groups within my sample. I would now like to use these weights to correct my sample data and then…

Vincent Twin
- 13
- 2
1
vote
0 answers
How to reweight to sustain covariate distributions across different samples with Python?
I have two independent samples, which vary in their numbers of observations and in the distributions of two variables (Let's assume there are no more variables). I want to sustain the distributions existing in set 1 for both variables in set 2 as…

spieler34
- 11
- 2
1
vote
1 answer
Translating Stata Code to R: survey weights
I'm trying to weight survey data in R. I'm using Stata code as a reference.
The code used on that program to weight my data was:
svyset [iw=wgtp], vce(sdr), sdrweight(wgtp1-wgtp80) mse
I translated that code into R code like this:
svydesign(ids…

Matt
- 11
- 2
1
vote
0 answers
In ensembles combining models, when, if ever, does it make sense for a model to have negative weight?
I would like to combine the result of some predictive models by weighting their results. In the most related works the weights of models are in the range of (0,1),But I have found that negative weights result in better prediction.So, at first, I set…

Mahboub Far
- 11
- 4
1
vote
1 answer
Why are the mean values not much closer to the original weightings?
I run the following program and a typical console output is as follows.
Mean percentage points for weighting 0 is: 57.935590153643616
Mean
percentage points for weighting 1 is: 42.06440984635654
Why are these printed means not much closer to…

danger mouse
- 1,457
- 1
- 18
- 31
1
vote
0 answers
How to adjust the cumulative period and weigh in python code(effective drought index(EDI:BYUN, WILHITE 1999)
I'm make a code, but big problem,, It takes too long to calculate.
In short, the definition of this EDI(Byun and wilhite 1999)
EDI is accumulate and weighting precipitation index
pr = precipitation, accumulate days : 365 days(1 years) after…

SangHoon
- 13
- 3
1
vote
0 answers
Elasticsearch weighting
I am having some trouble understanding how the weighting is calculated in my implementation of Elasticsearch. It is my understanding that unless you use Dismax that the score of the document is the sum of all weights and not the score of the max…

Paul Beliavskis
- 93
- 3
- 9
1
vote
1 answer
Random selection weighted against recent previous selections
I'd like to select an element of a list where each element is weight by how long since it was last selected.
I could make an LRU (least recently used) list with the weighting a function based on the position in the queue, which would be elegant…

hippietrail
- 15,848
- 18
- 99
- 158
1
vote
0 answers
LDA model on weighted data - R
I would like to use linear discriminant analysis model (lda) on my weighted data. In my data set, I have one column with weights which are not integers (I cant just replicate rows). lda function from MASS package does not allow me to use vector of…

spokowodza
- 23
- 3
1
vote
2 answers
Independent Sample T-Test After Weighting
I am trying to run an independent sample t-test with weights computed through propensity score. Y is the outcome variable (a continuous variable) and sec is the grouping variable having two categories (code 0 and 1). I used the following command:
…

Ahmed Arif
- 189
- 1
- 2
- 10
1
vote
1 answer
Weighted linear regression in R
I would like to do a linear regression with a weighting factor for an analytical chemistry calibration curve. The x values are concentration and assumed to have no error. The y values are instrument response and the variation is assumed…

MikeP
- 11
- 1
- 1
- 2