similar to: chisq.test

Displaying 20 results from an estimated 5000 matches similar to: "chisq.test"

2012 Dec 15
3
kruskalmc, significant differences while median values are the same
Dear list! I work with multiple Kruskal-Wallis test (kruskalmc, package pgirmess), which evaluates differences in medians among groups (5 groups). A result of a test is significant differences among some groups, while median values are the same for 4 groups (using tapply). Why? p.s.: number of samples in groups vary from 50 to 4900. Thanks to all, OV .
2012 Nov 17
3
transform input argument (matrix) of function
Dear list!   I would like to write a function to transform matrix, which is input argument of a written function. It is easy with new matrix (see below), but my idea is to transform input argument (matrix) of function without any additional matrixes. Here is an example: fun1 <- function(xy) { xy <- cbind(xy[,1], xy[,2], xy[,1] + xy[,2]) return(xy) }   df1 <- matrix(c(1,2,3,1,2,3), ncol =
2012 Nov 07
1
row index for max values of row groups
Dear list members! I am looking for ''nice solution'' for (maybe) simple problem. I need a code (small program) to calculate row index for max value (example below: df1$values) by groups (example below: df1$groups). df1 <- data.frame( groups = c(1,1,1,1,1,2,2,2,3,3,3,3), values = c(1,1,1,2,1,1,2,3,2,1,4,3) ) df1 expected results > 4 8 11 # row index of max values by group
2012 Apr 07
1
rgeos - gBuffer, width by z-value
Dear list! I have problem with buffer size (width) in package rgeos. I would like to expand given geometry (points) to specified width based on the z value from attribute table. Here is example: point <- data.frame(x=c(10,20), y=c(10, 10), z = c(2,7)) point_shp <- SpatialPointsDataFrame(point[,1:2],point) plot(point_shp, xlim = c(0,30), ylim = c(0,20)) plot(gBuffer(point_shp, width = 5,
2012 Nov 20
2
correct function formation in R
Dear list! ? I have question of?'correct function formation'. Which function (fun1 or fun2; see below) is written more correctly? Using ''structure'' as output or creating empty ''data.frame'' and then transform it as output? (fun1 and fun1 is just for illustration). ? Thanks a lot, OV ? code: input <- data.frame(x1 = rnorm(20), x2 = rnorm(20), x3 =
2011 Oct 22
1
setMethod "[" - extract by names within Slot
Hi R-helper! I have problem with setMethods for "[". Here is example : setClass("myClass", representation(ID.r = "numeric", ID.c = "character", DAT = "matrix")) to.myClass <- function(ID.r, ID.c, DAT) {     out <- new("myClass", ID.r = ID.r, ID.c = ID.c, DAT = DAT)     return(out)       }       setMethod("[",
2011 Oct 01
1
class definition
Hi everybody! I have a matrix of class "myClass", for example: myMat <- matrix(rnorm(30), nrow = 6) attr(myMat, "class") <- "myClass" class(myMat) When I extract part of ''myMat'', the corresponding class ''myClass'' unfortunately disappear: myMat.p <- myMat[,1:2] class(myMat.p) Please for any advice / suggestions, how
2012 Apr 15
1
match values from data.frame and vector
Dear R helpers! I have a vector 'x1' and data.frame 'df1'. Do you have any suggestion how to get vector x2, which will be a result of matching values from vector 'x1' and values from 'df1'? Please, see the example: x1 <- c(rep(1,3), rep(NA,2), rep(2,4)) df1 <- data.frame(c1 = c(1,2), c2 = c(5,6)) I would like to get vector x2: > x2 [1]  5  5  5 NA NA  6 
2012 Oct 30
1
mapply instead for loop
Hi all!   My question in about using mapply instead for loop. Below is a example with for loop: Is it posible to give same results with mapply function?   Thanks for help!   OV   x <- 1:10 y <- 1:10 xyz <- data.frame(expand.grid(x,y)[1], expand.grid(x,y)[2], z = rnorm(100)) names(xyz) <- c("x", "y", "z") head(xyz) size <- 2 output <- NULL   ### for
2012 Feb 28
1
colour by z value, persp in raster package
Hi all!   My question is how to colour pixels by z value in persp plot in raster package. Here is an example:     x <- seq(-1.95, 1.95, length = 30) y <- seq(-1.95, 1.95, length = 35) z <- outer(x, y, function(a,b) a*b^2) r1 <- raster(nrows=35, ncols=30, xmn=0, xmx=30, ymn = 0, ymx = 35) r1[] <- c(z) persp(r1)   There already exist some function to produce persp plot for anothe
2005 Jun 26
2
chisq.test using amalgamation automatically (possible ?!?)
Dear List, If any of observed and/or expected data has less than 5 frequencies, then chisq.test (Pearson's Chi-squared Test for Count Data from package:stats) gives warning messages. For example, x<-c(10, 14, 10, 11, 11, 7, 8, 4, 1, 4, 4, 2, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) y<-c(9.13112391745095, 13.1626482033341, 12.6623267638188, 11.0130706413029, 9.16415925139016,
2008 Jan 15
2
In chisq.test(x) : Chi-squared approximation may be incorrect
Hello, I received the following warning when running chi-square; n Is there a way to catch the 'error' code of 'warning' after run chisq.test(x)? n What does this error mean? Thank you for your help. [[alternative HTML version deleted]]
2008 Nov 16
3
chisq.test with simulate.p.value=TRUE (PR#13292)
Full_Name: Reginaldo Constantino Version: 2.8.0 OS: Ubuntu Hardy (32 bit, kernel 2.6.24) Submission from: (NULL) (189.61.88.2) For many tables, chisq.test with simulate.p.value=TRUE gives a p value that is obviously incorrect and inversely proportional to the number of replicates: > data(HairEyeColor) > x <- margin.table(HairEyeColor, c(1, 2)) >
2005 Oct 30
4
Yates' correction for continuity in chisq.test (PR#8265)
Full_Name: foo ba baz Version: R2.2.0 OS: Mac OS X (10.4) Submission from: (NULL) (219.66.32.183) chisq.test(matrix(c(9,10,9,11),2,2)) Chi-square value must be 0, and, P value must be 0 R does over correction when | a d - b c | < n / 2 &#65292;chi-sq must be 0
2006 Dec 02
1
Chi-squared approximation may be incorrect in: chisq.test(x)
I am getting "Chi-squared approximation may be incorrect in: chisq.test(x)" with the data bleow. Frequency distribution of number of male offspring in families of size 5. Number of Male Offspring N 0 518 1 2245 2 4621 3 4753 4 2476 5
2003 Mar 26
3
a statistic question about chisq.test()
Hi, In the chisq.test(), if the expected frequency for some categories is <5, there will be a warning message which says Warning message: Chi-squared approximation may be incorrect in: chisq.test(x, p = probs) I am wondering whether there are some methods to get rid of this mistake... Seems the ?chisq.test() doesn''t provide more options to solve this problem. Or, the only choice is
2005 Jun 22
1
chisq test and fisher exact test
Hi, I have a text mining project and currently I am working on feature generation/selection part. My plan is selecting a set of words or word combinations which have better discriminant capability than other words in telling the group id's (2 classes in this case) for a dataset which has 2,000,000 documents. One approach is using "contrast-set association rule mining" while the
2010 Aug 24
2
chisq.test on samples of different lengths
Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no year 2: no yes no yes I wanted to do a chisq.test, but if I enter it this way: chisq.test(year1, year2) I get the error saying the columns are two different lengths. So then I tried
2003 Jul 15
1
Why two chisq.test p values differ when the contingency table is transposed?
I'm using R1.7.0 runing with Win XP. Thanks, ...Tao ???????????????????????????????????????????????????????? >x [,1] [,2] [1,] 149 151 [2,] 1 8 >t(x) [,1] [,2] [1,] 149 1 [2,] 151 8 >chisq.test(x, simulate.p.value=T, B=100000) Pearson's Chi-squared test with simulated p-value (based on 1e+05 replicates) data: x X-squared = 5.2001, df =
2003 Dec 09
2
p-value from chisq.test working strangely on 1.8.1
Hello everybody, I'm seeing some strange behavior on R 1.8.1 on Intel/Linux compiled with gcc 3.2.2. The p-value calculated from the chisq.test function is incorrect for some input values: > chisq.test(matrix(c(0, 1, 1, 12555), 2, 2), simulate.p.value=TRUE) Pearson's Chi-squared test with simulated p-value (based on 2000 replicates) data: matrix(c(0, 1, 1,