Displaying 20 results from an estimated 75 matches for "gof".
Did you mean:
go
2007 May 21
2
Questions about bwplot
Dear R-experts,
I have some questions about boxplots with lattice.
My data is similar as in the example below, I have two factors
(Goodness of Fit and Algorithms) and data values but in each panels the scales are quite different, therefore the normal boxplots produced by
set.seed(1)
GOF <- factor(rep(c("GOF1","GOF2","GOF3"),each=40))
Alg <- rep(factor(rep(c("A1","A2","A3","R1"),each=10)),3)
Value <- c(runif(40),rnorm(40),rnorm(30,10,3),rnorm(10,20,3))
test.data <- data.frame(Alg=Alg,GOF=GOF,Value=Val...
2011 Jun 23
2
Rms package - problems with fit.mult.impute
...for goodness of fit of a logistic model (in rms package) after running fit.mult.impute?
I am using the rms and Hmisc packages to do a multiple imputation followed by a logistic regression model using lrm.
Everything works fine until I try to run the test for goodness of fit: residuals(type=c("gof"))
One needs to specify y=T and x=T in the fit. But I get a warning message when I do that with fit.multiple.impute.
a<-aregImpute(~med.hist.err+ med.discr+newLiving+No.drugs+Days.categ+Los+Age+Ward+Sex, n.impute=20, nk=0,data=med.err)
ddist<-datadist(Age,No.drugs,Days.categ, Sex, Livin...
2008 Jun 05
1
(baseline) logistic regression + gof functions?
?
Hallo,
which function can i use to do (baseline) logistic regression +
goodness
of fit tests?
so far i found:
# logistic on binary data
lrm combined with resid(model,'gof')
# logistic on binary data
glm with no gof-test
# baseline logit on binary data
multinom with no gof-test
(# also, what if the data are not binary and more than one
predictor in
the model?)
Hint...
2012 Mar 08
2
xyplot without external box
...the documentation of xyplot how to remove the
external box.
I would really appreciate any help with this
------------- START -----------
library(lattice)
x<-1:100
cuts <- unique( quantile( as.numeric(x),
probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1),
na.rm=TRUE) )
gof.levels <- cut(x, cuts)
nlevels <- length(levels(gof.levels))
xyplot(1~1, groups=gof.levels, type="n", xlab="", ylab="",
scales=list(draw=FALSE),
key = list(x = .5, y = .5, corner = c(0.5, 0.5),
title="legend",...
2016 Apr 26
0
survival::clogit, how to extract residuals for GOF assessment
Hi Folks,
Hopefully this question has enough R and not too much stats to be
appropriate for this list. Based on,* Hosmer et al. 2013. Logistic
regression for matched case-control studies. Applied Logistic
Regression *(eqtn.
7.8)*, *I am assessing GOF of conditional (or matched) logistic regression
models with the *standardized Pearson residuals*. The authors define
?large? as delta chi-squared values > 4.
For a 1:1 study, I can fit a conditional logistic model via an
unconditional routine by making the response variable all 1?s, taking the...
2010 Sep 01
1
[Q] Goodness-of-fit test of a logistic regression model using rms package
Hello,
I was looking for a way to evaluate the goodness-of-fit of a logistic regression model. After googling, I found that I could use "resid(fit, 'gof')" method implemented in the rms package. However, since I am not used to the "le Cessie-van Houwelingen normal test statistic," I do not know which statistic from the returned from the "resid(fit, 'gof')" call that I could use to evaluate the goodness of fit....
2011 Nov 20
2
ltm: Simplified approach to bootstrapping 2PL-Models?
Dear R-List,
to assess the model fit for 2PL-models, I tried to mimic the
bootstrap-approach chosen in the GoF.rasch()-function. Not being a
statistician, I was wondering whether the following simplification
(omit the "chi-squared-expressed model fit-step") would be appropriate:
GoF.ltm <- function(object, B = 50, ...){
liFits <- list()
for(i in 1:B){
rndDat <- rmvlogis(nrow(obje...
2007 May 18
0
Anderson-Darling GoF
Hi,
I'm not a statistician so sorry for possible trivial questions ...
I want to perform a GoF test on sample data against several distribution
(like Extreme Value, Phase Type, Pareto, ...).
Since I suspect a long-tailed behaviour on data I want to use
Anderson-Darling (AD) GoF test because it's well known it's more sensible to
tail data.
Looking at R packages the only AD test is t...
2007 May 18
0
Anderson-Darling GoF (re-sent)
Hi,
I'm not a statistician so sorry for possible trivial questions ...
I want to perform a GoF test on sample data against several distribution
(like Extreme Value, Phase Type, Pareto, ...).
Since I suspect a long-tailed behaviour on data I want to use
Anderson-Darling (AD) GoF test because it's well known it's more
sensible to tail data.
Looking at R packages the only AD test i...
2007 May 27
1
Parametric bootstrapped Kolmogorov-Smirnov GoF: what's wrong
Dear R-users,
I want to perform a One-Sample parametric bootstrapped Kolmogorov-Smirnov
GoF test (note package "Matching" provides "ks.boot" which is a 2-sample
non-parametric bootstrapped K-S version).
So I wrote this code:
---[R Code] ---
ks.test.bootnp <- function( x, dist, ..., alternative=c("two.sided", "less",
"greater"), B = 100...
2010 Jul 07
1
Different goodness of fit tests leads to contradictory conclusions
...g - 2, "P(>Chi)" = P)
}
> hosmerlem(no.NA$repcnd, fitted(mod.fit))
X^2 Df P(>Chi)
7.8320107 8.0000000 0.4500497
> # Option 2 - Hosmer–le Cessie omnibus lack of fit test:
> library(Design)
> lrm.GOF <- lrm(formula = no.NA$repcnd ~ no.NA$svl, data = no.NA, y = T, x = T)
> resid(lrm.GOF,type = "gof")
Sum of squared errors Expected value|H0 SD Z P
48.3487115 48.3017399 ...
2001 Dec 12
0
Next step after multiple GoF tests
All,
This may be a bit off topic so feel free to flame me ... my defence is
that I am using R.
I have data with case counts per family. I arrange the data in a simple
table of frequency classes (e.g. how many families with 0 cases, how
many with 1 case, &c.) and then GoF to Poisson and negative binomial. I
treat each family as a natural sampling unit but families are of
different size. I can do the above analysis for each family size but
would like to pool the results. Which way forward ... I am guessing that
I could use some extension of Mantel-Haenszel methods or...
2011 Aug 08
0
GOF of Student's t copula
Hi all,
I need to test gof of 3-dimensional t copula for my trivariate observed
data set. So I used the command
t.cop <- tCopula(c(0.785,0.283,0.613),dim=3,dispstr="un",df=6,df.fixed =
TRUE)
where c(0.785,0.283,0.613) is the correlation pattern of my data with 0.785
pearson correlation between variable 1-2, 0....
2005 Sep 14
1
Long lines with Sweave
I have used Sweave a lot the latest year, but never really used any long
function calls.
If I have code which look like this
-------------------------------------------------------------
gof <- benthic.flux(ID="Gulf of Finland",
meas.conc=conc,
bw.conc=bw.conc,
time=times,
substance=expression(DIC~(mmol~m^{-3}))
)
--------------------------------------------------------...
2005 Nov 01
1
help with hier.part
...le and is the number of
species at a particular point. The other variables are the explanatory
vars (vark, var2, var1, UK, U2, U1, GK, G2, G1, PK, P2, P1).
Here is Walsh's sample code for hier.part:
data(urbanwq)
env <- urbanwq[,2,8]
hier.part(urbanwq$lec, env, fam="gaussian", gof="Rssqu")
The code I wrote is
library(hier.part)
SRUSE<- read.table("F:\\GEORGIA\\species_richness\\SR_use2.txt", sep="
", header = TRUE, row.names = 1)
TEMP<- SRUSE[2:13]
hier.part(SRUSE$nat_est,TEMP, family="NegBin", gof="logLik", barplot=...
2011 Dec 19
2
On Corrections for Chi-Sq Goodness of Fit Test
...the philosophy behind how R implements corrections to chi-square statistical tests. At least in recent versions (I'm using 2.13.1 (2011-07-08) on OSX 10.6.8.), the chisq.test function applies the Yates continuity correction for 2 by 2 contingency tables. But when used as a goodness of fit test (GoF, aka likelihood ratio test), chisq.test does not appear to implement any corrections for widely recognized problems, such as small sample size, non-uniform expected frequencies, and one D.F.
From the help page:
"In the goodness-of-fit case simulation is done by random sampling from the discr...
2011 May 08
1
Hosmer-Lemeshow 'goodness of fit'
...#############################################33
# Compute the le Cessie and Houwelingen test
f <- lrm(Collaterals ~ CHF + Age + CABG
+ relevel (as.factor (num.obst.vessels),"one")
+ Current.smoker + DM + HTN + ace.inhibitor
+ MI, x=TRUE, y=TRUE)
library(Design)
resid(f, 'gof')
Output:
> hosmerlem(y=Collaterals, yhat=fitted(cd.full_model))
$chisq
[1] 6.275889
$p.value
[1] 0.6163585
> resid(f, 'gof')
Sum of squared errors Expected value|H0 SD
118.5308396 118.3771115 0.1435944...
2009 Apr 28
3
creating a vector of sums
...of-fit test for the Pareto Distribution for some loss data that I have.
So far I have the following:
function(X=OTOL)
{
n <- length(X)-1 #calculated the number of values (extra as 0 included)
i <- 2:640 #values of i
j <- 1:639 #values of i-1
Y <- (n-j+1)*((X[i])-(X[j])) #First part of GoF model
Y
}
Where OTOL is the ordered loss data (decreasing), and Y is a vector of length 639
What I need to do next is create another vector TY (of the same length) that is the the sum of part of the Y vector.
So TY[1]=Y[1]
TY[2]=Y[1]+Y[2]
TY[3]=Y[1]+Y[2]+Y[3]
and so on.
I have tried to do a s...
2000 Nov 03
1
Chi-square Goodness of Fit Test
Dear R-users,
is there a function for the Chi-square Goodness of Fit Test in R
(compare function chisq.gof in S/S-PLUS).
Thanks for help.
Matthias Seitzinger
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body&...
2005 Jan 08
0
cmdscale problem
Dear R developers,
there appears to be a small problem with function cmdscale: for
non-Euclidean distance matrices, using option add=FALSE (the default),
cmdscale misses the smallest eigenvalue. This affects GOF statistic g.1
(See Mardia, Kent + Bibby (1979): Multivariate Analysis, eq. (14.4.7).
The corresponding formula in Cox + Cox (2001): Multidimensional Scaling,
2nd ed., p 38, would seem to contain a misprint, it should be n instead
of n-1.)
Example:
R> cmdscale(eurodist, eig=TRUE)$GOF
[1] 0....