Displaying 20 results from an estimated 22 matches for "n11".
Did you mean:
11
2003 Aug 30
3
fisher.test() gives wrong confidence interval (PR#4019)
...ion, we can calculate the
probability mass of each possible table with same marginals as x.
Ref.: Alan Agresti (1990). Categorical data analysis. New York: Wiley.
Page 67.
Hence, the result below suggests that the two-sided confidence interval
has a confidence level of 97.5% as opposed to 95%.
n11 <- 7:9
theta <- 0.2985103
choose(9,n11)*choose(15-9,13-n11)*theta^n11/
sum(choose(9,n11)*choose(15-9,13-n11)*theta^n11)
#[1] 0.67344877 0.30154709 0.02500414
The 95% confidence interval with one-sided (greater) alternative appears
to be correct.
theta <- 0.4625314
choose(9,n11)*choose...
2009 Oct 16
1
How odds ratio is computed in fisher.test()?
I'm wondering how odds ratio is computed. I thought that it is
(n11/n12)/(n21/n22), but it is not what fisher.test() computes. Could
somebody let me know?
> n11=3
> n12=1
> n21=1
> n22=3
>
> n1_=n11+n12
> n2_=n21+n22
>
> n_1=n11+n21
> n_2=n12+n22
>
> x=rbind(c(n11,n12),c(n21,n22))
>
> threshold=dhyper(n11,n1_,n2_,n_1)
>...
2020 Oct 09
1
Aide pour finaliser ce code
...Debut du programme
for (n in N){
l1=0 # initialisation de la valeur permettant calculer le niveau de test ?
1%
l2=0 # initialisation de la valeur permettant calculer le niveau de test ?
5%
l3=0 # initialisation de la valeur permettant calculer le niveau de test ?
10%
# Cr?ation d'une liste n11 qui contient les tailles des differents groupes
n11=list()
for (i in 1:q){
n11[[i]]=rep(as.integer(n/R[i]),R[i])
n11[[i]][R[i]]=n-((R[i]-1)*n11[[i]][1])
}
# Cr?ation des listes P11 et P12 qui contient les probabilit?s et
# les inverses des probabilites empiriques des differents groupes
respectiv...
2013 Jun 24
1
help needed with printing multiple arguments as vectors, not matrices
**
I am using the following way to get p-values from fiser exact test.
However, I do need to print for each pair the values "n00, n01, n10, n11".
How can I print that as a table and not a matrix as below along with the
p-value? Any help will be greatly appreciated
fish <- function(y, x) {n00 = sum((1-x)*(1-y)); n01 = sum((1-x)*y);
n10 = sum(x*(1-y)); n11 = sum(x*y); a = matrix(c(n00, n01, n10, n11),
nrow = 2); pval = fisher.test(...
2020 Oct 10
3
Please need help to finalize my code
...quot;)
39 #Beginning of the program
40 for (n in N){
41 l1=0 # initialization of the value to calculate the test level at 1%.
42 l2=0 # initialization of the value to calculate the test level at 5%.
43 l3=0 # initialization of the value to calculate the test level at 10%.
44 # Creation of an n11 list containing the sizes of the different groups
45 n11=list()
46 for (i in 1:q){
47 n11[[i]]=rep(as.integer(n/R[i]),R[i])
48 n11[[i]][R[i]]=n-((R[i]-1)*n11[[i]][1])
49 }
50 # Creation of lists P11 and P12 which contain the probabilities and
51 # the inverses of the empirical probabilities of th...
2020 Oct 13
1
Please need help to finalize my code
...gt; 40 for (n in N){
>
>
> 41 l1=0 # initialization of the value to calculate the test level at 1%.
> 42 l2=0 # initialization of the value to calculate the test level at 5%.
> 43 l3=0 # initialization of the value to calculate the test level at 10%.
>
> 44 # Creation of an n11 list containing the sizes of the different groups
> 45 n11=list()
> 46 for (i in 1:q){
> 47 n11[[i]]=rep(as.integer(n/R[i]),R[i])
> 48 n11[[i]][R[i]]=n-((R[i]-1)*n11[[i]][1])
> 49 }
>
>
> 50 # Creation of lists P11 and P12 which contain the probabilities and
> 51 # the...
2020 Oct 13
0
Please need help to finalize my code
...> >
> > 41 l1=0 # initialization of the value to calculate the test level at 1%.
> > 42 l2=0 # initialization of the value to calculate the test level at 5%.
> > 43 l3=0 # initialization of the value to calculate the test level at 10%.
> >
> > 44 # Creation of an n11 list containing the sizes of the different groups
> > 45 n11=list()
> > 46 for (i in 1:q){
> > 47 n11[[i]]=rep(as.integer(n/R[i]),R[i])
> > 48 n11[[i]][R[i]]=n-((R[i]-1)*n11[[i]][1])
> > 49 }
> >
> >
> > 50 # Creation of lists P11 and P12 which contai...
2012 Nov 12
1
reshape
Hi,
I have a R output that looks as follow:
Rad:0
Rad1:2
Rad3:3
I want to make a new matrix that looks like : sample size is 2400
Variable n11 n12
Rad 0 2400-0=2400
Rad1 2 2400-2
Rad3 3 2400-3
Thanks a lot for your time and help:)
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
2012 Nov 13
4
for loop
...this in many ways:
dat1<-read.table(text="
med1,med2,med3????
?1,0,1??????
0,1,1???
2,0,0
",sep=",",header=TRUE)??
#1st method
library(reshape)
dat2<-melt(dat1)
dat3<-aggregate(dat2$value,by=list(dat2$variable),sum)
?colnames(dat3)<-c("name","sum(n11)")
?dat3
#? name sum(n11)
#1 med1??????? 3
#2 med2??????? 1
#3 med3??????? 2
#2nd method
res<-data.frame(colSums(dat1))
?names(res)<-"sum(n11)"
?res
#???? sum(n11)
#med1??????? 3
#med2??????? 1
#med3??????? 2
#3rd method
?do.call(rbind,lapply(dat1,sum))
#???? [,1]
#med1???...
2006 Jun 05
3
Fastest way to do HWE.exact test on 100K SNP data?
Hi everyone,
I'm using the function 'HWE.exact' of 'genetics' package to compute p-values of
the HWE test. My data set consists of ~600 subjects (cases and controls) typed
at ~ 10K SNP markers; the test is applied separately to cases and controls. The
genotypes are stored in a list of 'genotype' objects, all.geno, and p-values are
calculated inside the loop over all
2011 Oct 08
1
HWEBayes, swapping the homozygotes genotype frequencies
I evaluated the Bayes factor in the k=2 allele case with a "triangular"
prior under the null as in the example in the help file:
HWETriangBF2(nvec=c(88,10,2))
[1] 0.4580336
When I swap the n11 entry and n22 entry of nvec, I received totally
different Bayes factor:
>
> HWETriangBF2(nvec=c(2,10,88))
[1] 5.710153
>
In my understanding, defining the genotype frequency as n11 or n22 are
arbitrary.
So I was expecting the same value of Bayes factor.
This is the case for conjugate...
2002 May 21
2
using axis with newline characters
...ondering if I missed anything or if that's a problem with R:
I want to have many x axis tickmarks and labels such that it makes sense to put them on multiple "lines".
The newline character seems to be ignored though for axis labels:
plot(1:33, axes=F)
axis(1, 9, 9)
axis(1, 11, "\n11")
axis(1)
# whereas
title("one\ntwo")
works as I expect it to work.
In addition there is a little hook on top of the tickmark (the upper end of the vertical dash) that seems to be unintended.
Best regards,
Andreas Krause
PS. R version 1.4.1 on Red Hat Linux.
PPS. One way...
2004 Jun 30
1
Developing functions
Without trying to understand your code in detail let me just
assume you are trying to create a matrix, ret, whose i,j-th
entry is some function, f, of row i of X and row j of X.
In that case this should do it:
apply(X,1,function(x)apply(X,1,function(y)f(x,y)))
Date: Wed, 30 Jun 2004 15:28:47 -0300 (ART)
From: <daniel at sintesys.com.ar>
To: <r-help at stat.math.ethz.ch>
2007 Nov 30
0
Is there any multivariate regression function to combine all variables from a dataset?
...I need a function that combines all the values from the dataset in
order to produce the xi, xi*xj, xi*xj*xk values. The variables can take
values in different ranges so I need that the function controls the
scale. After that I would apply the regression to the obtained dataset.
Example
X1 X2
n11 n12
n21 n22
n31 n32
->
X1 X2 X1*X2
n11 n12 n11*n12
n21 n22 ...
n31 n32 ...
Is there any function like this in which, in addition of the above
mentioned, I can specify the degree of combination?
Thanks for your help,
Miguel
2012 Oct 15
1
library(rmeta)
Hello,
I have a data with following format:
Predictors n11 n12 n21 n22 Odds.Ratio log.ratio se.log.odds.
1 ProcOR respirato
2 ProcVaric vein
3 DiagCardiac anom
4 DiagAllergy
5 DiagOth skin dx
6 DiagGastritis
I want to plot odds ratio by command: forestplot in rmeta library, but I get the following err...
2004 Apr 19
11
Size of R user base
I have been trying to determine the size of the R user base, and was
asked to share my findings with this mailing list. Although I still
don't have any definite estimate of this number, I do have some
interesting and indicative information:
1. It appears that there are about 100,000 S-PLUS users.
Rationale: According to Insightful's 2002 Annual Report, over 100,000
people use
2008 Aug 22
2
help needed for HWE.exact in library "genetics"
.../G" "G/G" "G/G" "G/G" "G/G"
[73] "G/G" "G/G" "G/A" "G/G" "G/G" "G/G" "G/G" "G/G"
Alleles: G A
> HWE.exact(g1)
Exact Test for Hardy-Weinberg Equilibrium
data: g1
N11 = 71, N12 = 9, N22 = 0, N1 = 151, N2 = 9, p-value = 1
> control.data <-
c("G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G","G/G...
2004 Mar 15
1
gzfile & read.table on Win32
Hello ...
Are there any known problems or even gotchas to look out for when using a
gzfile connection in read.csv/read.table in Windows?
In the package PROcess, available at
www.bioconductor.org/repository/devel/package/html/PROcess.html
there are two files in the PROcess/inst/Test directory which are of the
extension *.csv.gz.
With both files, if I open up a gzfile connection, say:
vv <-
2010 May 13
1
Comparing histograms?
Rhelpers:
I'm curious what the appropriate analysis to use for testing the
hypothesis that two histograms are statistically different from one
another? Thanks!
--j
2011 Apr 16
0
Question abt power calculation in multistrata data using Hmisc or other package
...e function in Hmisc package. But it
seems that it is meant for two groups such as reference/control versus
cases.
This is the sample of data in each of the two groups:
Treatment_stat Death MonthsToEvent
1 0 60.0
2 1 55.3
0 1 36.7
0 1 39.9
number of cases in treatment strata :
group 1: n12=110; n11=25;n10=15 (N2=150)
group 2: n22=43;n21=8;n20=9 (N2=60)
Coxph
output indicates significant different survival in group 1 data but not
in group 2. How can one be sure that the lack of significance of
survival difference is true in group 2 and it is not because of fewer
number of cases in group 1 ?...