search for: chi2

Displaying 20 results from an estimated 58 matches for "chi2".

Did you mean: chi
2001 Dec 09
1
Help for Power analysis
...Nikom Thanomsieng. 29/09/2000 #Department of Biostatistics & Demography. Faculty of Public Health. #Khon Kaen University. Thailand. #Email: nikom at kku.ac.th #Modify data value of the first two line x1 <- c(6,9) x2 <- c(6,6) nc <-cbind(x1) nr <-rbind(x2) data1 <- rbind(x1,x2) chi2<- chisq.test(data1,correct=F)$statistic Ntotal<-sum(data1) df<- ncol(nc-1)*nrow(nr-1) ifelse(df==1,w<- sqrt(chi2/Ntotal), w<-sqrt(chi2/(chi2+Ntotal))) Ntotal1<-900 #change this if power not enough alpha <-0.05 #change this for One tailed =0.05 ncp<-0 chicrit<-NULL powe...
2005 Sep 12
0
Multiple comparisons like a Chi2 or Fisher's exact test
Dear all I have an experiment where plots either have or have not regrown (in 40 plots) after receiving 12 different herbicide treatments and a control (no treatment). The data are significant with a Chi2, but to later distinguish if the differences are significant between each of the 12 treatments apart I need to do multiple Chi2 s between each. Is there a way to run those multiple Chi2 or something like them so that each comparison is done in an automated fashion between the treatments? Have I mad...
2008 Feb 10
1
Error while using fitdistr() function or goodfit() function
...Warning message: > Chi-squared approximation may be incorrect in: summary.goodfit(gf) > > for another distribution: > gf<-goodfit(binCount,type= "poisson",method= "MinChisq") > Warning messages: > 1: NA/Inf replaced by maximum positive value in: optimize(chi2, range(count)) > 2: NA/Inf replaced by maximum positive value in: optimize(chi2, range(count)) > 3: NA/Inf replaced by maximum positive value in: optimize(chi2, range(count)) > 4: NA/Inf replaced by maximum positive value in: optimize(chi2, range(count)) > 5: NA/Inf replaced by maxi...
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
...1] th_ p[2] ll _ -sum(x[1:max(kk)]*log(dnbinom(kk[-length(kk)],r,th))) - x[length(kk)]*log(1-pnbinom((max(kk)-1),r,th)) return(ll) } a_ nlm(fn,p=c(.9,.5),hes=T) est_ a$est phat_ c(dnbinom(kk[-length(kk)],est[1],est[2]), 1-pnbinom((max(kk)-1),est[1],est[2])) E_ n*phat chi2_ sum((x-E)^2/E) cat('Chi2 goodness-of-fit = ',chi2,'\n') cat('P-value=',1-pchisq(chi2,df=length(kk)-1-2),'\n') print(cbind(O=x,E=round(E,1),err=round((x-E)^2/E,1))) =========================================== At 02:31 PM 2/8/01 +0000, Mark Wyatt wrote: >Yudi, &...
2001 Feb 07
3
Goodness of fit to Poisson / NegBinomial
...rep(2,17), rep(3,10), rep(4,9), rep(5,3), rep(6,2), rep(7,1)) tab <- table(mites) NSU <- length(mites) N <- sum(mites) NSU.Mean <- N / NSU exp <- dpois(as.numeric(dimnames(tab)[[1]]), NSU.Mean) * NSU chi2 <- sum(((as.vector(tab) - exp)^2) / exp) tab exp chi2 I have some small expected values and so need to collapse some categories. If anyone has code to do that already ... but my question is how would I do the same for a negative binomial distribution? Mark -- Mark Myatt -.-.-.-.-.-...
2007 Oct 10
5
chi2
Hello, I want to use the quantile function so I read the doc but I don't understand with this > qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1)) [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53 63550.14 63619.68 [18] 63707.24 63837.16 Can you help me please?
2001 May 17
1
glm
Hello, I need to fit a generalized linear model with a Chi2 (6 ddl) as error distribution and with "log" as link function. I have looked in help(family) and maybe I could use Gamma(link="log") but I do not know if I can, and where I can define the shape and the scale arguments of the gamma distribution. Maybe there is another may to do t...
2010 Apr 04
2
"mantel.haenszel.test for trend in S-plus doesn't work i R"
...c(1, 3), sum), 2, function(el) el * 1:s), 2, sum, simplify = F) s2 <- apply(apply(apply(array, c(1, 3), sum), 2, function(el) el * (1:s)^2), 2, sum) V <- sum((sum.case * (tot - sum.case) * (tot * s2 - s1^2))/(tot^ 2 * (tot - 1))) A <- abs(O - E) - 0.5 chi2 <- (abs(O - E) - 0.5)^2/V p <- 1 - pchisq(chi2, 1) incr <- ifelse(A > 0, "increasing", "decreasing") cat("\n", "Data:", deparse(substitute(array)), "\n") print(array) cat("\n", "The trend of",...
2011 Aug 05
1
Goodness of fit of binary logistic model
...el: ----------------------------------------------------------- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T) Model Likelihood Discrimination Rank Discrim. Ratio Test Indexes Indexes Obs 82 LR chi2 5.58 R2 0.088 C 0.607 0 46 d.f. 1 g 0.488 Dxy 0.215 1 36 Pr(> chi2) 0.0182 gr 1.629 gamma 0.589 max |deriv| 9e-11 gp 0.107 tau-a 0.107...
2010 Dec 22
0
fdrtool help
Hello, I am using fdrtool(x, statistic="pvalue") where x is a vector of chisq p-values. I can get this command to work with some x, but not with others. When it does NOT work, I get the following screen output: > fdrtool(pvals$Chi2.pval, statistic="pvalue") Step 1... determine cutoff point Step 2... estimate parameters of null distribution and eta0 Step 3... compute p-values and estimate empirical PDF/CDF Error in pvt.isoMean(-rawslope, dx) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning messag...
2012 Jun 04
1
Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")
...nce P(>|Chi|) 1 993 1283.7 2 1002 1368.2 -9 -84.554 2.002e-14 *** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 My question is: When I report this result, I would say /"cohorts were unevenly distributed between sites ( Chi2=84.5, df=9, p < 0.001)"/, is that correct? is the Chi2 value the difference of deviance between model with cohort effect and null model? -- View this message in context: http://r.789695.n4.nabble.com/Chi-square-value-of-anova-binomialglmnull-binomglmmod-test-Chisq-tp4632293.html Sent from...
2003 Mar 25
1
BUG report : 'rnorm' (LINUX, R 1.6.2) (PR#2682)
Dear colleague, unfortunately 'rnorm' does not create normal distributed numbers as you can see with following histogramm: > hist(rnorm(1000000),breaks=100) and > hist(pnorm(rnorm(1000000)),breaks=100) I have done several chi^2-tests which have all failed: > chi2unif<- function(x,N) > { > anz=length(x) > f0<-rep(anz/N,times=N) > fi<-(hist(x,g<-seq(length(N+1),from=0, by=1/N), plot=FALSE)[2]) > fin<-fi[[1]][1:N] > chi2=sum( ((f0-fin)^2)/f0 ) > pchisq(chi2,N-1) > } > chi2unif(x<-pnorm(rnorm(1...
2005 Jan 07
2
help with polytomous logistic regression
...the results Is it possible to get the following quantities: I: maximum likelihood estimates to test for fit of model and significance of each predictor (I would like to produce a table of the following type) Analysis of Variance: MLE (values are non sensical, I know!) df chi2 p intercept 2 57 .003 v1 4 89 .876 v2 2 7 .05 LR 110 450 0.93 II: chi square values and corresponding p-values for each level of the predictor variates (I'm OK for the estimates and se...
2011 May 18
1
logistic regression lrm() output
...-lrm(response~x,data=dat,x=T,y=T)) Logistic Regression Model lrm(formula = response ~ x, data = dat, x = T, y = T) Model Likelihood Discrimination Rank Discrim. Ratio Test Indexes Indexes Obs 150 LR chi2 17.11 R2 0.191 C 0.763 0 128 d.f. 1 g 1.209 Dxy 0.526 1 22 Pr(> chi2) <0.0001 gr 3.350 gamma 0.528 max |deriv| 1e-11 gp 0.129 tau-a 0.132...
2005 Jun 04
1
can R do Fixed-effects (within) regression (panel data)?
...545 R-sq: within = 0.1799 Obs per group: min = 8 between = 0.1860 avg = 8.0 overall = 0.1830 max = 8 Random effects u_i ~ Gaussian Wald chi2(14) = 957.77 corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+--------------------...
2003 Dec 04
2
Comparing Negative Binomial Regression in Stata and R. Constants differ?
...rcept estimates markedly differ. Can anybody explain this? ----------------------------------------------------------- Stata: nbreg daysabs gender mathnce langnce Negative binomial regression Number of obs = 316 LR chi2(3) = 20.74 Prob > chi2 = 0.0001 Log likelihood = -880.87312 Pseudo R2 = 0.0116 ------------------------------------------------------------------------------ daysabs | Coef. Std. Err....
2004 Nov 11
1
polr probit versus stata oprobit
...865 Residual Deviance: 1969.734 AIC: 1979.734 ############################################## #and here Stata's output ############################################## Ordered probit estimates Number of obs = 1000 LR chi2(2) = 802.86 Prob > chi2 = 0.0000 Log likelihood = -984.86675 Pseudo R2 = 0.2896 ------------------------------------------------------------------------------ XX | Coef. Std. Err. z P...
2007 Feb 13
1
lme4/lmer: P-Values from mcmc samples or chi2-tests?
Dear R users, I have now tried out several options of obtaining p-values for (quasi)poisson lmer models, including Markov-chain Monte Carlo sampling and single-term deletions with subsequent chi-square tests (although I am aware that the latter may be problematic). However, I encountered several problems that can be classified as (1) the quasipoisson lmer model does not give p-values when
2010 Dec 09
1
error in lrm( )
...+ T.Num + T.Grade + Year + TS, x = TRUE, y = TRUE) Model Likelihood Discrimination Rank Discrim. Ratio Test Indexes Indexes Obs 317 LR chi2 37.78 R2 0.154 C 0.693 0 201 d.f. 5 g 0.876 Dxy 0.386 1 116 Pr(> chi2) <0.0001 gr 2.400 gamma 0.408 m...
2013 Jan 24
4
Difference between R and SAS in Corcordance index in ordinal logistic regression
...Model Likelihood > Discrimination Rank Discrim. > Ratio Test > Indexes Indexes > Obs 32 LR chi2 53.14 R2 > 0.875 C 0.963 > max |deriv| 6e-06 d.f. 2 g > 8.690 Dxy 0.925 > Pr(> chi2) <0.0001 gr...