search for: pval

Displaying 20 results from an estimated 344 matches for "pval".

Did you mean: _val
2012 Mar 16
2
variable values in plotmath expressions
## I would like help in using variable values in plotmath expressions ## in lattice x <- 1:10 y <- 1:10 pval <- .95 plot(y ~ x, ## works as I want in base graphics main=substitute(list(alpha * " = " * group("",list(p),"")), list(p=pval))) plot(y ~ x, ## doesn't work as intended: "pval" is displayed main=substitute(list(alpha * " = " * gr...
2011 Jun 30
2
volcano plot.r
...row=length(means[,1]),         ncol=length(means[1,]),         dimnames=list(rownames(means),colnames(means))         )     for (ii in 1:length(means[,1]))         for (jj in 1:length(means[1,]))             folds[ii,jj]<-means[ii,jj]/means[1,jj]          #     #    t-test P value data     #     pvals<-matrix(nrow=ncol(data[,-1]),ncol=1,dimnames=list(colnames(data[-1]),"P-Value"))          #     #    Perform the t-Test     #     for(ii in 1:nrow(pvals)) {         pvals[ii,1]<-t.test(new_mats[[1]][,ii+1],new_mats[[2]][,ii+1])$p.value         }          m<-length(pvals)     x_r...
2005 Apr 29
0
Anscombe-Glynn, Bonett-Seier, D'Agostino
...s3 <- (sum((x-mean(x))^3)/n)/(sum((x-mean(x))^2)/n)^(3/2) y <- s3*sqrt((n+1)*(n+3)/(6*(n-2))) b2 <- 3*(n*n+27*n-70)*(n+1)*(n+3)/((n-2)*(n+5)*(n+7)*(n+9)) w <- sqrt(-1+sqrt(2*(b2-1))); d <- 1/sqrt(log10(w)); a <- sqrt(2/(w*w-1)); z <- d*log10(y/a+sqrt((y/a)^2+1)); pval <- pnorm(z, lower.tail = FALSE) if (alter == 0) { pval <- 2*pval if (pval > 1) pval<-2-pval alt <- "data have a skewness" } else if (alter == 1) { alt <- "data have positive skewness" } else { pval <- 1-pval alt <- "data have negative skew...
2011 Aug 29
3
how to start R script editor by default
Hi All, 1) Is it possible to set the options such that R opens a new script editor every time I start the R and 2) specify the size of windows. Thanks for the suggestion and Best regards, Krishna [[alternative HTML version deleted]]
2011 Jun 20
2
(no subject)
...ow=length(means[,1]), ncol=length(means[1,]), dimnames=list(rownames(means),colnames(means)) ) for (ii in 1:length(means[,1])) for (jj in 1:length(means[1,])) folds[ii,jj]<-means[ii,jj]/means[1,jj] # # t-test P value data # pvals<-matrix(nrow=ncol(data[,-1]),ncol=1,dimnames=list(colnames(data[-1]),"P-Value")) # # Perform the t-Test # for(ii in 1:nrow(pvals)) { pvals[ii,1]<-t.test(new_mats[[1]][,ii+1],new_mats[[2]][,ii+1])$p.value } m<-length(pvals) x_...
2020 Oct 15
0
package(moments) issue
moments::anscombe.test(x) does give errors when x has too few values or if all the values in x are the same > moments::anscombe.test(c(1,2,6)) Error in if (pval > 1) pval <- 2 - pval : missing value where TRUE/FALSE needed > moments::anscombe.test(c(2,2,2,2,2,2,2,2)) Error in if (pval > 1) pval <- 2 - pval : missing value where TRUE/FALSE needed You can use tryCatch() to return some special value where these errors occur. E.g., use tr...
2008 May 08
2
applying cor.test to a (m, n) matrix
...y own function to get a matrix of p.values and i suppose i can build similar functions for all the others. But i have used for loops and i wonder if there is any way to actually use one of the functions from the "apply" family to do this in a quicker way. Here is my little function: cor.pval <- function(x, method = c("pearson", "kendal", "spearman"), digit=8) { n <- dim(x)[2] pval <- matrix(paste(rep("c", n*n), seq(1,n*n), sep = ""), n, n, byrow = T) for (i in 1:n) { for (j in 1:n){ pval[i, j] <- cor.test(x[,i], x[,j], meth...
2020 Oct 15
2
package(moments) issue
...iate it. Best wishes, Sania On Thu, 15 Oct 2020 at 20:43, Bill Dunlap <williamwdunlap at gmail.com> wrote: > moments::anscombe.test(x) does give errors when x has too few values or if > all the values in x are the same > > > moments::anscombe.test(c(1,2,6)) > Error in if (pval > 1) pval <- 2 - pval : > missing value where TRUE/FALSE needed > > moments::anscombe.test(c(2,2,2,2,2,2,2,2)) > Error in if (pval > 1) pval <- 2 - pval : > missing value where TRUE/FALSE needed > > You can use tryCatch() to return some special value where these...
2012 Feb 27
1
How to incorporate interaction terms in MRM function of ecodist library?
...sign or (:) between two terms that I'd like to check the interaction for, I get same results as with just additive model. Is there something that I do wrong? Thanks, *For example: * > mrm.S10z_A<- MRM(Adis ~ S10z.st+Distance.st, nperm=100) > mrm.S10z_A $coef Adis pval Int 0.553605282 0.06 S10z.st -0.002587542 0.86 Distance.st 0.028866573 0.07 $r.squared R2 pval 0.004180399 0.060000000 $F.test F F.pval 4.634535 0.060000 > mrm.S10z_A<- MRM(Adis ~ S10z.st*Distance.st, nperm=100) > mrm.S10z_A $coef...
2007 Mar 20
1
wishlist -- Fix for major format.pval limitation (PR#9574)
Full_Name: Charles Dupont Version: 2.4.1 OS: linux 2.6.18 Submission from: (NULL) (160.129.129.136) 'format.pval' has a major limitation in its implementation. For example suppose a person had a vector like 'a' and the error being ?0.001. > a <- c(0.1, 0.3, 0.4, 0.5, 0.3, 0.0001) > format.pval(a, eps=0.01) If that person wants to have the 'format.pval' output with 2 digi...
2020 Oct 15
2
package(moments) issue
Hi all, While running the anscombe.test in R, I'm getting an error of *Error in if (pval > 1) pval <- 2 - pval : missing value where TRUE/FALSE needed* for a few time series columns whereas for most of the series the function is working fine. I have checked for those specific columns for missing values. However, there is no NA/NAN value in the dataset. I have also run kurtosis f...
2020 Oct 15
0
package(moments) issue
Another bad case is > moments::anscombe.test(rep(c(1,1.1),length=35)) Error in if (pval > 1) pval <- 2 - pval : missing value where TRUE/FALSE needed I haven't checked the formulas carefully, but I suspect the problem is from taking the cube root of a negative number in z <- (1 - 2/(9 * a) - ((1 - 2/a)/(1 + xx * sqrt(2/(a - 4))))^(1/3))/sqrt(2/(9 * a)) In R, th...
2007 Aug 21
0
pvals.fnc unhappy about lmer objects
...ssor Bates), I'm quite confused as to the current status of some of the available functions applicable to lmer objects. Following the examples in Baayen, Davidson, Bates (2006), my plan is to run mcmcsamp on a random effect model created by lmer in package lme4, then use the (perhaps outdated) pvals to estimate p-value. But then I couldn't find pvals anywhere. So question number one is : Has pvals been replaced? by pvals.fnc in the package languageR perhaps? >From the help page, it's stated that pvals.fnc takes a model fitted with lmer, in contrast with the pvals I've read a...
2008 Jul 23
2
Warning message in if else statement
Hi, I am using an if else statement inside a function ?. If I use that function I have no problems ?. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value <- "< 2.2e-16" else p_value <- pval : the condition has length> 1 and only the first element will be used Using the second function I get the expected results, with a real p-value even if it is extremely small, or " _______________________________________...
2012 Dec 14
1
format.pval () and printCoefmat ()
Hi List, My goal is to force R not to print in scientific notation in the sixth column (rel_diff - for the p-value) of my data frame (not a matrix). I have used the format.pval () and printCoefmat () functions on the data frame. The R script is appended below. This issue is that use of the format.pval () and printCoefmat () functions on the data frame gives me the desired results, but coerces the character string into NAs for the two character variables, because my objec...
2007 Feb 20
0
fix for a major format.pval limitation
'format.pval' has a major limitation in its implementation for example suppose a person had a vector like 'a' and the error being ?0.001. > a <- c(0.1, 0.3, 0.4, 0.5, 0.3, 0.0001) > format.pval(a, eps=0.001) The person wants to have the 'format.pval' output with 2 digits...
2007 Mar 02
0
Patch for format.pval limitation in format.R
'format.pval' has a major limitation in its implementation for example suppose a person had a vector like 'a' and the error being ?0.001. > a <- c(0.1, 0.3, 0.4, 0.5, 0.3, 0.0001) > format.pval(a, eps=0.001) The person wants to have the 'format.pval' output with 2 digits...
2008 Oct 01
1
pvals.fnc in lme4 and languageR
Hi everybody! I was using the function pvals.fnc from package 'languageR' until April. I do not know which version. Yesterday I updated all my packages and tried to run my loop again. Now I get the following error message: error in pvals.fnc(mm, nsim = 1000) : MCMC sampling is not yet implemented in lme4_0.999375-27 for models with...
2011 Apr 21
1
Error running pvals.fnc in R version 2.13.0
Dear R-help: I've been trying to run pvals.fnc in the newest version of R (2.13.0). The function lmer worked fine, but when I tried to use pvals.fnc on the lmer object, I got the following error: "Error in pvals.fnc(elogr.subj.dys.sum.3x3.p, nsim = 10000) : trying to get slot "coefs" from an object (class "summaryDef...
2007 May 27
1
Parametric bootstrapped Kolmogorov-Smirnov GoF: what's wrong
...uot;p", dist, sep="" ); rvg <- paste( "r", dist, sep="" ) ; rvg <- get( rvg, mode = "function" ); ks <- ks.test( x, cdf, ..., alternative = alternative ); # KS stat from sample # bootstrapping K-S ... ks.pval <- 0; for ( i in 1:B ) { # Samples from the theoretical distribution y <- rvg( n.x, ... ); # Performs a K-S test ks.boot <- ks.test( x, y, alternative = alternative ); # Updates p-value...