Displaying 20 results from an estimated 1300 matches similar to: "Winsorisation function"
2001 Mar 22
2
Two-argument functions in tapply()
Hello to all.
My question is very simple...
Let's say we have a data frame with three variables (columns): X, W and F. X
is a numeric variable (e.g. like income) F is a factor (e.g. with 2 levels)
and W is a case weight (data are from household sample but an individual was
interviewed, weights are functions of number of persons in the house hold).
I wanted to compute a means of X weighted
2005 Aug 26
1
Help in Compliling user -defined functions in Rpart
I have been trying to write my own user defined function in Rpart.I
imitated the anova splitting rule which is given as an example.In the
work I am doing ,I am calculating the concentration index(ci) ,which
is in between -1 and +1.So my deviance is given by
abs(ci)*(1-abs(ci)).Now when I run rpart incorporating this user
defined function i get the following error message:
Error in
2007 Feb 18
3
User defined split function in rpart
Dear R community,
I am trying to write my own user defined split function for rpart. I read
the example in the tests directory and I understand the general idea of the
how to implement user defined splitting functions. However, I am having
troubles with addressing the data frame used in calling rpart in my split
functions.
For example, in the evaluation function that is called once per node,
2008 Dec 30
3
Componentwise means of a list of matrices?
Dear useRs,
I have a list, each entry of which is a matrix of constant dimensions.
Is there a good way (i.e., not using a for loop) to apply a mean to each
matrix entry *across list entries*?
Example:
foo <- list(rbind(c(1,2,3),c(4,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
2006 Oct 10
2
find weighted group mean
HI,
I am trying to figure out an efficient way to calculate group means and
associate each entry with it. I made up an example:
A = rep(rep(0:1,each=2),3)
B = rep(rep(0:1,4),3)
C = rep(rep(c(0,0,1,1),2),3)
X =cbind(rnorm(24,0,1),runif(24,0,1),A,B,C)
A B C
[1,] -1.92926469 0.32213127 0 0 0
[2,] -0.83935617 0.77794096 0 1 0
[3,] -1.27799751
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 =>
2009 Mar 15
1
Stuck on building a package
Folks,
I have a personal package which used to build fine. Today when I tried
to build the package again, some errors popped up. Could you please
help? When I paste the offending function into an R it works
correctly. But the package build breaks.
$ R CMD check ansecon
* checking for working pdflatex ... OK
* using log directory '/Users/ajayshah/L/R/packages/ansecon.Rcheck'
* using R
2017 Nov 24
2
Multiple sets of proportion tests
Hi all ,
I have a dataframe of 200 columns and 2 rows. The first row in each column contains the frequency of cases in group I . The second row in each column contains the frequency of cases in group II. The frequency of trails is a fixed value for group I(e.g.200) and it is also another fixed values for group II (e.g. 100). The dataset looks like this :-
> Mydata
2017 Nov 24
0
Multiple sets of proportion tests
Hi anonymous,
?prop.test states that it returns a list. And one of the element is
'p.value'. str() on the output of prop.test() reveals that too. So
prop.test()$p.value or prop.test()["p.value"] should work.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR
2017 Nov 24
1
Multiple sets of proportion tests
Thank you for clarifying this point but my main question was about how to modify my code to do the analysis correctly. The code I mentioned :-
MyResults <- apply(Mydata, 2, function(x)prop.test(Mydata,c(200,100))
Results in this error : 'x' and 'n' must have the same length in the prop.test(x,n).
How can I modify "x' or "n" arguments so the analysis
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
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
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.
So I need to winsorize the variable but
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
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
2011 Jan 25
2
ggplot geom_boxplot and stat_smooth
Dear all
I would like to superpose some smoothing line through boxplot in ggplot
> dput(ad)
structure(list(konc.f = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L,
7L, 7L, 7L, 7L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L,
1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L,
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)
2008 Jun 15
1
recursive beta with cutoffs on large data set
dear R experts: I have an academic question that borders on asking
for consulting help, so I hope I am not too imposing. If I am, please
ignore me.
My data set has 100MB data set of daily stock returns. I want to
compute rolling (recursive?) betas---either bivariate or
multivariate---with respect to some other data time series. Many of
these regressions are "take away the first
2013 Apr 21
1
lsoda question from deSolve package
Dear List,
Wonder if you have some thoughts on the following question using lsoda in desolve:
I have the following data and function:
require(deSolve)
times <- c(0:24)
tin <- 0.5
D <- 400
V <- 26.3
k <-0.056
k12 <- 0.197118
k21 <- 0.022665
yini <- c(dy1 = 0,dy2 = 0)
events <- data.frame(var = "dy1",time = c(10,15),value = c(200,100),method =
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