search for: weight

Displaying 20 results from an estimated 6864 matches for "weight".

2000 Jan 04
0
Stepwise logistic discrimination - II
...+351-22-5580043 -------------- next part -------------- > nose20s.mu <- multinom(Spoilage ~ FRAG25 + FRAG26 + FRAG27 + FRAG28 + FRAG29 + FRAG30 + FRAG31 + FRAG32 + FRAG33 + FRAG34 + FRAG35 + FRAG36 + FRAG37 + FRAG38 + FRAG39 + FRAG40 + FRAG41 + FRAG42 + FRAG43 + FRAG44 + FRAG45 , nose126s) # weights: 92 (66 variable) > nose20s.mu Call: multinom(formula = Spoilage ~ FRAG25 + FRAG26 + FRAG27 + FRAG28 + FRAG29 + FRAG30 + FRAG31 + FRAG32 + FRAG33 + FRAG34 + FRAG35 + FRAG36 + FRAG37 + FRAG38 + FRAG39 + FRAG40 + FRAG41 + FRAG42 + FRAG43 + FRAG44 + FRAG45, data = nose126s) Coeffi...
2002 Feb 06
4
Weighted median
Is there a weighted median function out there similar to weighted.mean() but for medians? If not, I'll try implement or port it myself. The need for a weighted median came from the following optimization problem: x* = arg_x min (a|x| + sum_{k=1}^n |x - b_k|) where a : is a *positive* real scalar x :...
2011 Jan 17
2
Using summaryBy with weighted data
Dear Soren and R users: I am trying to use the summaryBy function with weights. Is this possible? An example that illustrates what I am trying to do follows: library(doBy) ## make up some data response = rnorm(100) group = c(rep(1,20), rep(2,20), rep(3,20), rep(4,20), rep(5,20)) weights = runif(100, 0, 1) mydata = data.frame(response,group,weights) ## run summaryBy wi...
2006 Aug 04
2
why does lm() not allow for negative weights?
Dear List, Why do commonly used estimator functions (such as lm(), glm(), etc.) not allow negative case weights? I suspect that there is a good reason for this. Yet, I can see reasonable cases when one wants to use negative case weights. Take lm() for example: ### n <- 20 Y <- rnorm(n) X <- cbind(rep(1,n),runif(n),rnorm(n)) Weights <- rnorm(n) # Includes Pos and Neg Weights Weights # Now do...
2007 May 31
3
Problem with Weighted Variance in Hmisc
The function wtd.var(x,w) in Hmisc calculates the weighted variance of x where w are the weights. It appears to me that wtd.var(x,w) = var(x) if all of the weights are equal, but this does not appear to be the case. Can someone point out to me where I am going wrong here? Thanks. Tom La Bone [[alternative HTML version deleted]]
2012 Oct 08
1
weighted cumulative distribution with ggplot2
Dear all, I am trying to draw a weighted cumulative distribution (as defined here http://rss.acs.unt.edu/Rdoc/library/spatstat/html/ewcdf.html) with ggplot2 however the syntax temp<-qplot(X,weight=weight,data=data,stat = "ecdf", geom = "step",colour=factor(year)) seems not to produce exactly the right figure (t...
2009 Nov 14
4
Weighted descriptives by levels of another variables
I've noticed that R has a number of very useful functions for obtaining descriptive statistics on groups of variables, including summary {stats}, describe {Hmisc}, and describe {psych}, but none that I have found is able to provided weighted descriptives of subsets of a data set (ex. descriptives for both males and females for age, where accurate results require use of sampling weights). Does anybody know of a function that does this? What I've looked at already: I have looked at describe.by {psych} which will give descrip...
2012 Jul 03
2
EM algorithm to find MLE of coeff in mixed effects model
...row is the miu_i tmp1=permutations(length(gausspar$nodes),2,repeats.allowed=T) tmp2=c(tmp1) a.mat=matrix(gausspar$nodes[tmp2],nrow=nrow(tmp1)) #a1,a1 #a1,a2 #... #a10,a9 #a10,a10 a.mat.list=as.list(data.frame(t(a.mat))) tmp1=permutations(length(gausspar$weights),2,repeats.allowed=T) tmp2=c(tmp1) weights.mat=matrix(gausspar$weights[tmp2],nrow=nrow(tmp1)) #w1,w1 #w1,w2 #... #w10,w9 #w10,w10 L=chol(solve(W.hat)) LL=sqrt(2)*solve(L) halfb=t(LL%*%t(a.mat)) # each page of b.array is all values of bi_k and bi_j for b...
2008 Mar 10
3
Weighting data when running regressions
Dear R-Help, I'm new to R and struggling with weighting data when I run regression. I've tried to use search to solve my problem but haven't found anything helpful so far. I (successfully) import data from SPSS (15) and try to run a linear regression on a subset of my data file where WEIGHT is the name of my weighting variable (numeric),...
2006 Aug 30
5
working with summarized data
The data sets I am working with all have a weight variable--e.g., each row doesn't mean 1 observation. With that in mind, nearly all of the graphs and summary statistics are incorrect for my data, because they don't take into account the weight. **** For example "median" is incorrect, as the quantiles aren't calculate...
2008 Jul 23
2
Weighted variance function?
There is a R function to calculate weighted mean : weighted.mean() under stats package. Is there any direct R function for calculating weighted variance as well? [[alternative HTML version deleted]]
2005 Apr 13
1
logistic regression weights problem
Hi All, I have a problem with weighted logistic regression. I have a number of SNPs and a case/control scenario, but not all genotypes are as "guaranteed" as others, so I am using weights to downsample the importance of individuals whose genotype has been heavily "inferred". My data is quite big, but with a dummy...
2011 Jul 06
2
how to best present concentrated data points/ ggplot2
Hi all, I am trying to plot a weighted density plot for two different types and want to show the data points on the x axis. The code is as follows. The data points are very concentrated. Is there a better way to present it( should I set the alpha value or something else)? Thanks! YL library(ggplot2) x <- rnorm(10000) a <-...
2017 May 11
2
What's the weight means in the dump of edge info from USR2?
Thank you, that is very helpful. And actually I do have a few further questions regarding this: 1. This weight is not the one specified in Subnet, this should be something related to the host, where can I manually configure this? 2. The weight value is ONLY take round trip latency as the measurement, or including CPU power and other factors into consideration? 3. I don't know how this Weight named, bu...
2012 Jul 18
1
How does "rlm" in R decide its "w" weights for each IRLS iteration?
Hi all, I am also confused about the manual: a. The input arguments: wt.method are the weights case weights (giving the relative importance of case, so a weight of 2 means there are two of these) or the inverse of the variances, so a weight of two means this error is half as variable? w (optional) initial down-weighting for each case. init (optional) initial values for the coefficients OR...
2009 Jul 23
5
Random # generator accuracy
..."It would be necessary to see the code for your 'brief test' before anyone could meaningfully comment on your results. But your results for a single test could have been a valid "random" result." I've re-created what I did below. The problem appears to be with the weighting process: the unweighted sample came out much closer to the actual than the weighted sample (>1% error) did. Comments? Jim > x [1] 1 2 3 4 5 6 7 8 9 10 11 12 > weights [1] 1 1 1 1 1 1 2 2 2 2 2 2 > a = mean(replicate(1000000,(sample(x, 3, prob = weights))));a # (1 milli...
2008 Jun 03
3
Rpart and case weights: working with functions
I can't get rpart accept case weights defined inside a function. It keeps using the copy defined in the "global" environment (if they exists) instead of the function-defined ones. Here is what I do: test.function <- function (formula, data) { weights <- rep(.1, 100) rpart(formula, data, weights) } test.functi...
2007 May 08
5
Weighted least squares
Dear all, I'm struggling with weighted least squares, where something that I had assumed to be true appears not to be the case. Take the following data set as an example: df <- data.frame(x = runif(100, 0, 100)) df$y <- df$x + 1 + rnorm(100, sd=15) I had expected that: summary(lm(y ~ x, data=df, weights=rep(2, 100))) summary...
2017 May 10
2
What's the weight means in the dump of edge info from USR2?
Hi, tinc experts abc to def at x.x.x.x port 655 options d weight 540 How’s the 540 weight been calculated? What does it mean? How can I leverage this weight? The d of after options mean direct?
2010 Apr 16
2
Weights in binomial glm
I have some questions about the use of weights in binomial glm as I am not getting the results I would expect. In my case the weights I have can be seen as 'replicate weights'; one respondent i in my dataset corresponds to w[i] persons in the population. From the documentation of the glm method, I understand that the weights can indeed...