Displaying 20 results from an estimated 10000 matches similar to: "[Q] How to fit data to a straight line"
2006 Mar 06
2
[Q] BIC as a goodness-of-fit stat
Dear R-List
I have a question about how to interpret BIC as a goodness-of-fit statistic.
I was trying to use "EMclust" and other "mclust" library and found that BIC
was used as a goodness-of-fit statistic.
Although I know that smaller BIC indicates a better fit, it is not clear to
me how good a fit is by reading a BIC number. Is there a standard way of
interpreting a BIC
2007 Jan 12
1
R2WinBugs and Compare DIC versus BIC or AIC
Dear All
1)
I'm fitting spatial CAR models
using R2Winbugs and although everything seems to go reasonably well (or I
think so)
the next message appears from WINBUGS 1.4 window:
gen.inits()
Command #Bugs: gen.inits cannot be executed (is greyed out)
The question is if this message means that something is wrong and the
results are consequently wrong, or Can I assume it as a simple warning
2005 Apr 18
2
Why no BIC.default function?
I'm using R 2.0.1.
I looked in the email archives but didn't see anything on this topic.
I've noticed a surprising (to me) difference between AIC and BIC:
> methods("AIC")
[1] AIC.default* AIC.logLik*
> methods("BIC")
[1] BIC.gls* BIC.lm* BIC.lme* BIC.lmList* BIC.logLik* BIC.nls*
The BIC.gls BIC.lm BIC.lme BIC.lmList and BIC.nls functions appear
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,
2004 May 18
0
nlme: Initial parameter estimates
Hello,
I am trying to fit a nlme (non linear mixed effect). I am using the SelfStart function SSlogis. However the data in my hand contains few observations per subject (4 or less), so the nlsList doesn't work... In this case I should fixe initial parameter estimates. I remark that values of initial estimates have a greater effect on the model fit (i.e. loglikelihood, AIC and also on
2006 Feb 12
1
Mathematical typesetting of column heads using the latex (Hmisc) function
Dear r-helpers,
I would very much appreciate help with the following problem:
The following command (in a .Rnw file)
latex(anova(e7.lmer3, e7.lmer4), file = 'e7lmer34.tex', rowname = c
('nonlinear', 'linear'), longtable = FALSE, dcolumn = T, booktabs =
T, table.env = F)
produces the following output after running Sweave:
% latex.default(anova(e7.lmer1, e7.lmer2),
2010 May 18
1
BIC() in "stats" {was [R-sig-ME] how to extract the BIC value}
>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch>
>>>>> on Tue, 18 May 2010 12:37:21 +0200 writes:
>>>>> "GaGr" == Gabor Grothendieck <ggrothendieck at gmail.com>
>>>>> on Mon, 17 May 2010 09:45:00 -0400 writes:
GaGr> BIC seems like something that would logically go into stats
2008 May 13
1
R help: problems with step function
Dear List Members,
I have encountered two problems when using the step function to
select models. To better illustrate the problems, attached is an
R image which includes the objects needed to run the code attached.
lm.data.frame have factor variables with 3 levels.
The following run shows the first problem. AICs (* and **) are different.
I noticed that the Df for rs13482096:rs13483699 is 4,
2008 May 14
0
Problems with step function
Dear List Members,
I have encountered two problems when using the step function to
select models. To better illustrate the problems, an R image
(step.add1.test.RData)
which includes the objects needed to run the code (step.add1.test.R) can be
found at
www.biostat.wisc.edu/~pwang/r-help/<http://www.biostat.wisc.edu/%7Epwang/r-help/>
lm.data.frame have factor variables with 3 levels.
The
2011 Mar 17
1
generalized mixed linear models, glmmPQL and GLMER give very different results that both do not fit the data well...
Hi,
I have the following type of data: 86 subjects in three independent groups (high power vs low power vs control). Each subject solves 8 reasoning problems of two kinds: conflict problems and noconflict problems. I measure accuracy in solving the reasoning problems. To summarize: binary response, 1 within subject var (TYPE), 1 between subject var (POWER).
I wanted to fit the following model:
2008 May 23
0
Est. Component Size with AIC/BIC under Gamma Distribution
Dear all,
I am trying to model number of samples from
a given series. The series are modelled according
Gamma function.
In order to estimate the # samples, I use BIC/AIC
with MLE (computed from dgamma function).
Here is the code I have.
__BEGIN__
mlogl <- function( x_func, theta_func, samp) {
# computing log_likelihood
return( - sum(dgamma(samp, shape = x_func, scale=theta_func, log
2006 Mar 28
2
[Q] How to make a multi-line title with expression()
Dear R-lister
Could anyone know how to make a multi-line title for a plot with
expression()?
In my plot, the title should be writeen in two lines (because it is two long
for one line) and it should use a mathematical expression. I tried to use
"\n", but "\n" is ignored in expression() call:
hist(diffChangeRequestHintsBeforeAnswering[,4], br = 50, xlab = "Skill
Change in
2008 Sep 24
2
Error message when calculating BIC
Hi All,
Could someone help me decode what this error means ?
> BIC(nb.80)
Error in log(attr(object, "nobs")) :
Non-numeric argument to mathematical function
>
BTW, nb.80 is a negative binomial glm model created using the MASS
library with the call at the bottom of the message
In the hopes of trying to figure this out I tried the following
workaround but it did not work
2006 Jul 07
1
convert ms() to optim()
How to convert the following ms() in Splus to Optim in R? The "Calc" function is also attached.
ms(~ Calc(a.init, B, v, off, d, P.a, lambda.a, P.y, lambda.y,
10^(-8), FALSE, 20, TRUE)$Bic,
start = list(lambda.a = 0.5, lambda.y = 240),
control = list(maxiter = 10, tol = 0.1))
Calc <- function(A.INIT., X., V., OFF., D.,
P1., LAMBDA1., P2., LAMBDA2.,
TOL., MONITOR.,
2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using
stepAIC() from MASS package.
Based on various information available in WEB, stepAIC() use
extractAIC() to get the criteria used for model selection.
I have created a new extractAIC() function (and extractAIC.glm() and
extractAIC.lm() ones) that use a new parameter criteria that can be AIC,
BIC or AICc.
It works as
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list:
funweek <- function(df)
if (length(df$elapsed_time) > 5) {
res = fitdist(df$elapsed_time,"exp")
year = df$sale_year[1]
sample = df$sale_week[1]
mid = df$m_id[1]
estimate = res$estimate
sd = res$sd
samplesize = res$n
loglik = res$loglik
aic = res$aic
bic = res$bic
chisq =
2007 Nov 09
0
question about fitted values from geoR - results 'too good'
Hi
cross posting from sig geo , because I really need help!
I'm using geoR for some spatial linear models and I'm getting
surprisingly optimistic values from the spatial models relative to the
non-spatial, even when the models appear to be performing about
equally (by AIC comparison)
For example
This model relating encounter rates of lizards to a soil substrate
parameter gives
>
2009 Apr 15
2
AICs from lmer different with summary and anova
Dear R Helpers,
I have noticed that when I use lmer to analyse data, the summary function
gives different values for the AIC, BIC and log-likelihood compared with the
anova function.
Here is a sample program
#make some data
set.seed(1);
datx=data.frame(array(runif(720),c(240,3),dimnames=list(NULL,c('x1','x2','y'
))))
id=rep(1:120,2); datx=cbind(id,datx)
#give x1 a
2006 Oct 18
1
lmer- why do AIC, BIC, loglik change?
Hi all,
I am having issues comparing models with lmer. As an example, when
I run the code below the model summaries (AIC, BIC, loglik) differ between
the summary() and anova() commands. Can anyone clear up what's wrong?
Thank you!
Darren Ward
library(lme4)
data(sleepstudy)
fm1<-lmer(Reaction ~ Days + (1|Subject), sleepstudy)
summary(fm1)
fm2<-lmer(Reaction ~ Days +
2006 Jan 23
1
nlme in R v.2.2.1 and S-Plus v. 7.0
Dear R-Users,
I am comparing the nlme package in S-Plus (v. 7.0) and R (v. 2.2.1, nlme
package version 3.1-68.1; the lattice, Matrix, and lme4 have also just
been updated today, Jan. 23, 2006) on a PC (2.40 GHz Pentium 4 processor
and 1 GHz RAM) operating on Windows XP. I am using a real data set with
1,191 units with at most 4 repeated measures per unit (data are
incomplete, unbalanced). I