Displaying 20 results from an estimated 3000 matches similar to: "Testing for strength of fit using R"
2007 Sep 05
1
ecological meaning of randomForest vegetation classification?
Hi, everyone,
I haven't found anything similar in the forum, so here's my problem (I'm no
expert in R nor statistics):
I have a data set of 59.000 cases with 9 variables each (fractional
coverage of 9 different plant types, such as deciduous broad-leaved
temperate trees or evergreen tropical trees etc.), which was generated by a
vegetation model.
In order to evaluate the quality of
2006 Feb 22
3
elements that appear only once
Hi.
I have a factor and I want to extract just those elements that appear  
exactly once.
How to do this?
Toy example follows.
 > a <- as.factor(c(rep("oak",5) ,rep("ash",1),rep("elm",1),rep 
("beech",4)))
 > a
[1] oak   oak   oak   oak   oak   ash   elm   beech beech beech beech
Levels: ash beech elm oak
 > table(a)
a
   ash beech   elm   oak
2008 Nov 26
2
Chi-Square Test Disagreement
I was asked by my boss to do an analysis on a large data set, and I am
trying to convince him to let me use R rather than SPSS. I think Sweave
could make my life much much easier. To get me a little closer to this
goal, I ran my analysis through R and SPSS and compared the resulting
values. In all but one case, they were the same. Given the matrix
    [,1] [,2]
[1,]  110  358
[2,]   71  312
[3,] 
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,
2011 Oct 23
3
How to create a new variable based on parts of another character variable.
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111023/ae046d6a/attachment.pl>
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))
>
2012 Mar 06
1
How to apply two parameter function in data frame
I know this is something simple that I cannot do because I do not yet "think"
in R.
I have a data frame has a variable participation (a factor), and several
other factors.
I want a chisq test (no contingency tables) for participation vs all of the
other factors.
In SPSS I would do:
CROSSTABS
  /TABLES= (my other factors) BY participation
  /FORMAT=NOTABLES
  /STATISTICS=CHISQ 
 
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,
2004 Oct 09
2
Is it safe? Cochran etc
I have the following contingency table
dat <- matrix(c(1,506,13714,878702),nr=2)
And I want to test if their is an association between events 
A:{a,not(a)} and B:{b,not(b)}
        | b   | not(b) |
--------+-----+--------+
 a      |   1 |  13714 |
--------+-----+--------+
 not(a) | 506 | 878702 |
--------+-----+--------+
I am worried that prop.test and chisq.test are not valid given the
2006 May 18
4
Nested design
Dear list members,
I'd like to perform a glm analysis with a hierarchically nested design. In
particular,
I have one fixed factor ("Land Use Classes") with three levels and a random
factor ("quadrat") nested within Land Use Classes with different levels per
classes (class artificial = 1 quadrat; class crops = 67 quadrats; and class
seminatural = 30 quadrats).
I have four
2005 Dec 20
2
2 x 2 chisq.test (PR#8415)
Full_Name: nobody
Version: 2.2.0
OS: any
Submission from: (NULL) (219.66.34.183)
2 x 2 table, such as
> x
     [,1] [,2]
[1,]   10   12
[2,]   11   13
> chisq.test(x)
	Pearson's Chi-squared test with Yates'
	continuity correction
data:  x 
X-squared = 0.0732, df = 1, p-value = 0.7868
but, X-squared = 0.0732 is over corrected.
when abs(a*d-b*c) <= sum(a,b,c,d), chisq.value
2006 Jan 11
2
Browser problem, Misrepresentation of .html in Solaris Firefox (PR#8471)
Hi there
I hope that I am in the right forum.
I am working on Win2000 PC connected via Exceed 6.0.1.0 to a
SunOS fluke 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-480R
There I am using Mozilla Firefox 1.0.7 as a browser.
I am having
difficulties viewing .html files. Their first pages are displayed
normally, black on white, links in blue. When I scoll down, the pages
appear black
2011 Oct 11
3
Chi-Square test and survey results
An organization has asked me to comment on the validity of their
recent all-employee survey.  Survey responses, by geographic region, 
compared
with the total number of employees in each region, were as follows:
> ByRegion
           All.Employees Survey.Respondents
Region_1            735                142
Region_2            500                 83
Region_3            897                 78
2012 Dec 03
4
Chi-squared test when observed near expected
Dear UseRs,
I'm running a chi-squared test where the expected matrix is the same as the
observed, after rounding.  R reports a X-squared of zero with a p value of
one.  I can justify this because any other result will deviate at least as
much from the expected because what we observe is the expected, after
rounding.  But the formula for X-squared, sum (O-E)^2/E gives a positive
value.  What
2005 May 26
1
Chi Square Test on two groups of variables
Dear R help
I have been trying to conduct a chi square test on two groups of variables
to test whether there is any relationship between the two sets of variables
chisq.test(oxygen, train)
        Pearson's Chi-squared test
data:  oxygen 
X-squared = 26.6576, df = 128, p-value = 1
> chisq.test(oxygen)
        Pearson's Chi-squared test
data:  oxygen 
X-squared = 26.6576, df = 128,
2011 Oct 24
1
How to create a new variable based on parts of another character variable: A generalization
... Well, this works in this simple case, but is too clumsy for a general
formulation of this problem:  given a "dictionary" consisting of two
character vectors of unique "names" (or two columns in a data frame), x and
y,  how does one convert a factor z with levels in x into the corresponding
equivalent with levels in y?
There are likely a zillion ways to do this with various
2002 May 23
2
Find if there is independence
Hello
I have the matrix
a<-matrix(c(2,1,0,1,2,2,1,5,7,2,5,12),nrow=6)
a
      [,1] [,2]
[1,]    2    1
[2,]    1    5
[3,]    0    7
[4,]    1    2
[5,]    2    5
[6,]    2   12
Suppose that in the first row we have 3 men of England, 2 with hair, and 1
no
In the second we have 6 italian men, 1 with hair and 5 no ...
I want to find if there is a dependence between men withouth hair and
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 		            
2012 Dec 01
4
Getting all possible contingency tables
Hello all,
Let say I have 2-way contingency table:
Tab <- matrix(c(8, 10, 12, 6), nr = 2)
and the Chi-squared test could not reject the independence:
 > chisq.test(Tab)
         Pearson's Chi-squared test with Yates' continuity correction
data:  Tab
X-squared = 1.0125, df = 1, p-value = 0.3143
However I want to get all possible contingency tables under this 
independence