search for: winsor

Displaying 16 results from an estimated 16 matches for "winsor".

Did you mean: windsor
2009 Jan 16
2
Winsorizing Multiple Variables
Hi All, I want to take a matrix (or data frame) and winsorize each variable. So I can, for example, correlate the winsorized variables. The code below will winsorize a single vector, but when applied to several vectors, each ends up sorted independently in ascending order so that a given observation is no longer on the same row for each vector. S...
2009 Aug 27
2
Winsorized mean and variance
Hello everybody, after searching around for quite some time, I haven't been able to find a package that provides a function to compute the Windorized mean and variance. Also I haven't found a function that computes the trimmed variance. Is there any such package around? thanks, Roberto
2012 Nov 14
1
Winsorisation function
Dear all, someone can find what I doing wrong with the following function. It is for winsorisation mean. At my eyes it is ok, but for reason I sometimes it is changing the results when I change the k value. wmean <- function (x, na.rm = FALSE, k = 1) { if (any(i.na <- is.na(x))) { if (na.rm) x <- x[!i.na] else return(NA) }...
2010 Aug 01
3
remove extreme values or winsorize – loop - dataframe
Hi everyone! #I need a loop or a function that creates a X2 variable that is X1 without the extreme values (or X1 winsorized) by industry and year. #My reproducible example: firm<-sort(rep(1:1000,10),decreasing=F) year<-rep(1998:2007,1000) industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7,10),rep(8,10),rep(9,10), rep(10,10)),1000) X1<-rnorm(10000) data<-data.frame(firm...
2008 Jun 15
1
recursive beta with cutoffs on large data set
...either bivariate or multivariate---with respect to some other data time series. Many of these regressions are "take away the first observation, add one observation at the end," which means I really have only about 30,000 unique regressions---still, quite a good number. Worse, I want to winsorize the rolling y-vector at different levels (99%&1%, 98%&2%, ...), so I want to repeat this procedure a few hundred times at different winsorization levels. The most important version of my task is bivariate regressions, which may mean that I don't even need MV overhead. I was even th...
2008 Dec 30
3
Componentwise means of a list of matrices?
...,5,6)),rbind(c(7,8,9),c(10,11,12))) some.sort.of.apply(foo,FUN=mean) I'm looking for a componentwise mean across the two entries of foo, i.e., the following output: [,1] [,2] [,3] [1,] 4 5 6 [2,] 7 8 9 [NB. My "real" application involves trimming and psych::winsor(), so anything that generalizes to this would be extra good.] I've been looking at apply and {s,l,m,t}apply, by, with and aggregate and searched the list archives... any ideas? Thanks a lot, Stephan
2007 Oct 25
1
meaning of "trim" in mean()
(I see this in both R-patched r43124 and R-devel r43233.) In the Argument section of ?mean: trim the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed. Values outside that range are taken as the nearest endpoint. Then in the Value section: If trim is non-zero, a symmetrically trimmed mean is computed with a fraction of trim observations
2010 May 16
2
Problems with Asterisk and two Linksys SPA941
Hi I have a big problems on my Asterisk systems : I have one Asterisk Server with static IP (no nat) and 6 Linksys SPA941. All SPA are after a router with NAT: * SPA-1 and SPA-2 are on the same network, we have a pat 5060 => SPA-1 and 5061=> SPA-2 on the internet router * SPA-3, we have a pat 5062 => SPA-3 * SPA-4, we have a pat 5063 =>
2012 Jun 14
0
fixed trimmed mean for j-group
.../((1-2*alpha)*n1)*(sum(mat1[e1:f1]) + r1*(mat1[k1]+mat1[n1-k1+1])) trim2=1/((1-2*alpha)*n2)*(sum(mat2[e2:f2]) + r2*(mat2[k2]+mat2[n2-k2+1])) trim3=1/((1-2*alpha)*n3)*(sum(mat3[e3:f3]) + r3*(mat3[k3]+mat3[n3-k3+1])) trim4=1/((1-2*alpha)*n4)*(sum(mat4[e4:f4]) + r4*(mat4[k4]+mat4[n4-k4+1])) ## sample winsorized mean x1=(1-r1)*mat1[k1+1]+r1*mat1[k1] x2=(1-r2)*mat2[k2+1]+r2*mat2[k2] x3=(1-r3)*mat3[k3+1]+r3*mat3[k3] x4=(1-r4)*mat4[k4+1]+r4*mat4[k4] u1=(1-r1)*mat1[n1-k1]+r1*mat1[n1-k1+1] u2=(1-r2)*mat2[n2-k2]+r2*mat2[n2-k2+1] u3=(1-r3)*mat3[n3-k3]+r3*mat3[n3-k3+1] u4=(1-r4)*mat4[n4-k4]+r4*mat4[n4-k4+1]...
2010 Jul 07
3
quantiles on rows of a matrix
I'm trying to obtain the mean of the middle 95% of the values from each row of a matrix (that is, the highest and lowest 2.5% of values in each row are removed before calculating the mean). I am having all sorts of problems with this; for example the command: apply(matrix1,1,function(x) quantile(c(.05,.90),na.rm=T)) returns the exact same quantile values for each row, which is clearly
2012 Jul 07
0
fixed trimmed mean for group
...n2)*(sum(__mat2[e2:f2]) + > r2*(mat2[k2]+mat2[n2-k2+1])) > trim3=1/((1-2*alpha)*n3)*(sum(__mat3[e3:f3]) + > r3*(mat3[k3]+mat3[n3-k3+1])) > trim4=1/((1-2*alpha)*n4)*(sum(__mat4[e4:f4]) + > r4*(mat4[k4]+mat4[n4-k4+1])) > > ## sample winsorized mean > x1=(1-r1)*mat1[k1+1]+r1*mat1[__k1] > x2=(1-r2)*mat2[k2+1]+r2*mat2[__k2] > x3=(1-r3)*mat3[k3+1]+r3*mat3[__k3] > x4=(1-r4)*mat4[k4+1]+r4*mat4[__k4] > > u1=(1-r1)*mat1[n1-k1]+r1*mat1[__n1-k1+1] > u2=(1-r2)*mat2[n2-k2]+r2*m...
2011 Sep 28
1
removing outliers in non-normal distributions
...tlier removal systems. It seems like most of the replies center around "why do you want to remove them", "you shouldn't remove them", "it depends", etc. so I've tried to add a lot of notes below in an attempt to answer these questions in advance.) Currently we Winsorize using the quantile function to get the new high and low values to set the outliers to on the high end and low end (this is summarized legacy code that I am revisiting): #Get the truncated values for resetting: lowq = quantile(dat,probs=perc_low,na.rm=TRUE) hiq = quantile(dat,probs=perc_hi,na.rm...
2012 May 29
1
need help to find type I error rate for modified F statistic
Hello everyone, I want to calculate type I error rate for modified F statistic for one way robust anova. I need to find the j group trimmed mean and winsorized sum of squared deviations. Here I attached my code for j=2 to make it simple. Originally I have j=4. Hope you can help. I need to run it for 1000 times My problem is: i) the value of F-test obtain from my simulation below is in negative value..There might be something wrong in my coding ii) a...
2004 Sep 23
6
detection of outliers
Hi, this is both a statistical and a R question... what would the best way / test to detect an outlier value among a series of 10 to 30 values ? for instance if we have the following dataset: 10,11,12,15,20,22,25,30,500 I d like to have a way to identify the last data as an outlier (only one direction). One way would be to calculate abs(mean - median) and if elevated (to what extent ?) delete the
2008 Jun 23
4
Ubuntu, Counterstrike Source, crashes after loading a game
Hello, Well, first let me say - I've looked in the APP database for this game. I've tried to trouble shoot everything I've read on the site. Here's my system: Ubuntu 64-bit 8.04 AMD 5800+ 4gb of Winsor Ram Nvidia 8500 GT Intel onboard sound Here's what's happening: Whenever I load up a game on CSS, it crashes after a gun shot. You can walk around, and everything just fine - but when someone shoots a gun - the game dies. Why it's weird: It USED to work. It stopped working abou...
2011 Aug 12
2
Plotting and quantiles
Dear R users, This is most likely very basic question but I am new to R and would really appreciate some tips on those two problems. 1) I need to plot variables from a data frame. Because of some few high numbers my graph is really strange looking. How could I plot a fraction of the samples (like 0.1 (10%), 0.2 up to for example 0.6) on x axis and values 'boundaries' (like any value