search for: weights

Displaying 20 results from an estimated 6900 matches for "weights".

Did you mean: 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) Coeffic...
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 : is a real scalar n : is an integer b_k: are negative and positive scalars
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 wit...
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 W...
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 (the values seems higher at some points)... I am wrong in the
2009 Nov 14
4
Weighted descriptives by levels of another variables
...stics 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 descriptives by levels of another variable (eg. mean ages of males and females), but does not accept sample weights. I have also looked at describe {Hmisc}...
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
...le where WEIGHT is the name of my weighting variable (numeric), e.g.: library(foreign) data1=read.spss("File.sav", use.value.labels = FALSE, to.data.frame = TRUE) summary(data1) ' shows me all the variables OK attach(data1) linmod=lm(Y~X1+X2+X3+X4W, subset=(X5==1 & X6==7), weights==WEIGHT) and I get the following Error message: Error in weights == WEIGHT : comparison (1) is possible only for atomic and list types It works perfectly if I don't use the ", weights==WEIGHT" bit Could you please let me know what I am doing wrong? Thank yo...
2006 Aug 30
5
working with summarized data
...--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 calculated with weights: sum( weights[X < median(X)] ) / sum(weights) This should be 0.5... of course it's not. **** Unfortunately, it seems that most(all?) of R's graphics and summary statistic functions don't take a weight or frequency argument. (Fortunately the models do...) Am I completely mis...
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 example: > status <- c(1,1,1,0,0) > SNPs <- matrix( c(1,0,1,0,0,0,0,1,0,1,0,1,0,1,1), ncol =3) > weight <- c(0.2, 0.1, 1, 0.8, 0.7) > glm(s...
2011 Jul 06
2
how to best present concentrated data points/ ggplot2
...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 <- rnorm(5000) b <- rnorm(5000) weights.x <- abs(a/sum(a)) weights.y <- abs(b/sum(b)) weight <- c(weights.x, weights.y) ze <- rep(0,10000) type <- c(rep("a",5000), rep("b",5000)) d <- data.frame(expo = x, weight = weight, type = type, ze = ze) m <- ggplot(d, aes(x = expo, group = type, col =...
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
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
...d "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 million samples from x, of size 3, weighted by "weights"; the mean should be 7.50) [1] 7.406977 > 7.406977/7.5 [1] 0.987597 > b = mean(replicate(1000000,(sample(x, 3))));b # (1 m...
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.functio...
2007 May 08
5
Weighted least squares
...'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(lm(y ~ x, data=rbind(df,df))) would be equivalent, but they are not. I suspect the difference is how the degrees of freedom is calculated - I had expected it to be sum(weights), but seems to be sum(weights > 0). This seems unintuitive to me: summary(lm(y ~ x, data=df, w...
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...