Displaying 20 results from an estimated 20000 matches similar to: "sign(<permutation>) in R ?"
2009 Dec 18
2
Generating permutations that always include one specific element
Dear R community,
I am trying to create a matrix of permutations of a vector:
bands <- c("AL", "B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O", "P",
"PI", "PK", "PU", "R", "V", "W", "Y")
Each permutation must be 4
2011 Oct 14
2
non-parametric permutation and signed paired-difference distributions
Hi all
Consider the classic data below from Darwin on the heights of 15 pairs
of zea mays (corn) plants
either cross-fertilized or self-fertilized, where the goal is to see if
it makes a difference.
> head(ZeaMays)
pair pot cross self diff
1 1 1 23.500 17.375 6.125
2 2 1 12.000 20.375 -8.375
3 3 1 21.000 20.000 1.000
4 4 2 22.000 20.000 2.000
5 5 2 19.125
2011 Sep 17
2
onet.permutation()
I saw the manual of this function but not sure what to do.
I have a array contain 7 numbers and want to choose 4 to do permutation
test. But using this function with parameters as onet.permutation(scores,4),
it returns 0. Instead, with no parameter, onet.permutation(), it returns
something but every time it's different.
Please tell me how am I supposed to do it.
Thanks a lot
--
View this
2018 May 23
0
find the permutation function of a sorting
> On May 22, 2018, at 10:57 PM, John <miaojpm at gmail.com> wrote:
>
> Thanks, David.
> I got the answer from the web.
> Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks,
>
>
> > x <- c(10,7,4,3,8,2)
> > sort(x, index.return=TRUE)
> $x
> [1] 2 3 4 7 8 10
>
> $ix
> [1] 6 4 3 2
2018 May 23
3
find the permutation function of a sorting
Thanks, David.
I got the answer from the web.
Is there any easy way to permute a set (e.g., a set of characters) by the
permutation it returns? Thanks,
> x <- c(10,7,4,3,8,2)
> sort(x, index.return=TRUE)
$x
[1] 2 3 4 7 8 10
$ix
[1] 6 4 3 2 5 1
2018-05-23 10:49 GMT+08:00 David Winsemius <dwinsemius at comcast.net>:
>
>
> > On May 22, 2018, at 10:06 PM, John
2018 May 23
0
find the permutation function of a sorting
Hello,
Like David said, what you are trying to do with sort() can be done with
order() in a much easier way.
First, your code
x <- sort(c("bc","ac","dd"), index.return=TRUE)
Now, with function order()
i <- order(c("bc", "ac", "dd"))
y <- c("D","E", "F")[i]
y
#[1] "E" "D"
2018 May 23
3
find the permutation function of a sorting
> sort(c("bc","ac","dd"), index.return=TRUE)
$x
[1] "ac" "bc" "dd"
$ix
[1] 2 1 3
We have the permutation, namely 1-->2, 2-->1, 3-->3.
How can I apply the permutation function to a new set
c("D","E", "F")?
so that the result is
c("E","D", "F").
2018-05-23 11:06
2018 May 23
2
find the permutation function of a sorting
Hi,
Is there any way to find the permutation function of the sorting and to
apply the function (or its inverse) elsewhere?
For example, the following permutation function from the sorting in the
matrix form is
c(1,2,3), c(2,1,3)
> sort(c("bc","ac","dd"))
[1] "ac" "bc" "dd"
I try to find it in the permutations/permute
2009 Aug 14
1
Permutation test and R2 problem
Hi,
I have optimized the shrinkage parameter (GCV)for ridge and got my r2
value is 70% . to check the sensitivity of the result, I did permutation
test. I permuted the response vector and run for 1000 times and draw a
distribution. But now, I get r2 values highest 98% and some of them more
than 70 %. Is it expected from such type of test?
*I was under impression that, r2 with real data set
2018 May 23
0
find the permutation function of a sorting
> On May 22, 2018, at 10:06 PM, John <miaojpm at gmail.com> wrote:
>
> Hi,
>
> Is there any way to find the permutation function of the sorting and to
> apply the function (or its inverse) elsewhere?
>
> For example, the following permutation function from the sorting in the
> matrix form is
> c(1,2,3), c(2,1,3)
>
>>
2007 Nov 16
4
Permutation of a distance matrix
Hi there,
I would like to find a more efficient way of permuting the rows and columns of a symmetrical matrix that represents ecological or actual distances between objects in space. The permutation is of the type used in a Mantel test.
Specifically, the permutation has to accomplish something like this:
Original matrix addresses:
a11 a12 a13
a21 a22 a23
a31 a32 a33
Example
2009 Aug 31
1
permutation test - query
Hi,
My query is regarding permutation test and reshuffling of genotype/phenotype
data
I have been using the haplo.stats package of R. for haplotype analysis and I
would like to perform an analysis which I'm requesting your advice.
I have a data set of individuals genotyped for 12 SNP and a dichotomous
phenotype.
At first, I have tested each of those SNP independently in order to bypass
2010 Sep 16
1
The permutation of one vector into another
Dear R-help-list
I have two character vectors
a <- c("A", "B", "C")
b <- c("A", "C", "B")
Then
sapply(a, function(i) grep(i, b))
computes the permutation of the entries in 'b' needed
to bring 'b' into the same order as 'a'.
I have searched around, but haven't been able to find
any existing function
2005 Nov 29
2
permutation test for linear models with continuous covariates
Hi I was wondering if there is a permutation test available in R for linear
models with continuous dependent covariates. I want to do a test like the
one shown here.
bmi<-rnorm(100,25)
x<-c(rep(0,75),rep(1,25))
y<-rnorm(100)+bmi^(1/2)+rnorm(100,2)*x+bmi*x
H0<-lm(y~1+x+bmi)
H1<-lm(y~1+x+bmi+x*bmi)
anova(H0,H1)
summary(lm(y~1+x+bmi))
But I want to use permutation testing to
2012 Apr 28
3
Writing a Permutation Function
Hi everyone,
I am somewhat new to R and I am trying to write a permutation function such
that it inputs a character vector and from an arbitrary length "n" which is
the length of the combinations for the character vector. I know there are R
packages for permutation but this is for an assignment.
So far this is what I have:
alphabet =
2012 Jul 12
1
permutation test on paired samples
Hi,
I'm trying to run a permutation test on paired samples.
First I tried the package "exactRankTests":
require("exactRankTests")
x <- c(1.83,0.50,1.62,2.48,1.68,1.88,1.55,3.06,1.30)
y <- c(0.878,0.647,0.598,2.05,1.06,1.29,1.06,3.14,1.29)
wilcox.test(x,y,paired = TRUE,alternative = "greater")
perm.test(y,x,paired = TRUE,exact = TRUE,alternative =
2002 Nov 26
1
permutation
The gregmisc package contains a function 'perumutations' which generates all
permutations of n choose r. It also contains 'combinations' which generates
all combinations, and which appears to match your example:
> library(gregmisc)
Loading required package: MASS
Attaching package `gregmisc':
The following object(s) are masked from package:base :
2011 Jan 24
2
Masking commands - Permutation in gregmisc and e1071
I am using the function permutations from the package *gregmisc*. However, I
am also making use of the package *e1071*, which also contains a function
called permutations. I want to use the function permutations from the *
gregmisc* package, however, the other package is masking this function. This
happens both when I load the *e1071* package before *gregmisc* and when I
load *e1071* after I load
2005 Nov 30
1
Permutation tests for correlations
Apropos the question about permutation tests in multiple regression:
We do have perm.test in package ExactRankTests, but it does one- and
two-sample tests, as in t.test, wilcox.test, etc. There doesn't seem
to be an exact version of the permutation test for correlations, i.e.,
the one that could be estimated using
replicate(10000, cor(x,sample(y))) # or other values of 10000
or, of course,
2012 Jun 09
2
Help with permutation function from Turner et al. 2010 (Ecology)
Hello,
I'm using R code that includes a residual permutation that was written as a supplement to the paper:
Turner et al. 2010. A general hypothesis-testing framework for stable isotopes ratios in ecological studies. Ecology 91:2227-2233.
The supplemental code is available at: http://www.esapubs.org/archive/ecol/E091/157/suppl-1.htm
When I execute the function, no warnings are given