Displaying 20 results from an estimated 3000 matches similar to: "find bayesian information criterion for all variable combinations"
2008 Jul 07
2
Running "all possible subsets" of a GLM (binomial) model
I have spent a fair amount of time looking for a package that is automated
to run glm (binomial) regression models with all possible subsets of my
independent variables. Something akin to Lumley's "leaps" package, but can
be applied to glms, not just lms; or something similar to Stata's brute
force "tryem" function? If anyone can point me in the right direction I
2010 Aug 17
2
how to selection model by BIC
Hi All:
the package "MuMIn" can be used to select the model based on AIC or AICc.
The code is as follows:
data(Cement)
lm1 <- lm(y ~ ., data = Cement)
dd <- dredge(lm1,rank="AIC")
print(dd)
If I want to select the model by BIC, what code do I need to use? And when
to select the best model based on AIC, what the differences between the
function "dredge" in
2008 Nov 18
1
"deparse" with "nlines" argument produces empty elements (PR#13299)
Full_Name: Kamil Barto?
Version: 2.8.0
OS: windows xp
Submission from: (NULL) (212.33.92.187)
According to the "deparse" function documentation "nlines" is the *maximum*
number of lines to produce. But, when "nlines" argument is supplied, it produces
exactly nlines of result, and the result contains empty elements at the end.
Example:
>
2010 Aug 10
2
question about bayesian model selection for quantile regression
Hi All:
Recently I am researching my dissertation about the quantile model selection
by bayesian approach. I have the dependent variable(return) and 16
independent variables and I need to select the best variable for each
quantile of return. And the method I used is the bayesian approach, which is
based on calculating the posterior distibution of model identifier. In other
words, I need to obtain
2008 Feb 18
4
newbie (me) needs to model distribution as two overlapping gaussians
Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either
1) determine the mean and SD for each of the two distributions
OR
2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution
In case I'm using the wrong language, my data looks something like
2010 Oct 12
1
delta AIC for models with 2 variables using MuMIn
Dear List,
I want to ask a AIC question based on package library(MuMIn)
The relative importance of 16 explanatory variables
are assessed using delta AIC in a generalized linear model.
Please kindly advise if it is possible to show models
with any two only certain variables.
Thank you.
Elaine
I asked a similar question and got a great help for models
with only one variable as below.
2013 Jan 18
1
Object created within a function disappears after the function is run
Dear R-helpers,
I have run the code below which I expected to make an object called dd1,
but that object does not exist.
So, in summary, my problem is that my function is meant to make an object
(dd1), and it does indeed make that object (I know that the last line of
the function prints it out) but then, after the function has run, the
object has disappeared.
It's late on a Friday so I may
2011 Jul 13
3
Sum weights of independent variables across models (AIC)
Hello,
I'd like to sum the weights of each independent variable across linear
models that have been evaluated using AIC.
For example:
> library(MuMIn)
> data(Cement)
> lm1 <- lm(y ~ ., data = Cement)
> dd <- dredge(lm1, beta = TRUE, eval = TRUE, rank = "AICc")
> get.models(dd, subset = delta <4)
There are 5 models with a Delta AIC Score of
2013 Mar 18
1
try/tryCatch
Hi All,
I have tried every fix on my try or tryCatch that I have found on the
internet, but so far have not been able to get my R code to continue with
the "for loop" after the lmer model results in an error.
Here is two attemps of my code, the input is a 3D array file, but really
any function would do....
metatrialstry<-function(mydata){
a<-matrix(data=NA, nrow=dim(mydata)[3],
2003 Jul 30
2
Comparing two regression slopes
Hello,
I've written a simple (although probably overly roundabout) function to
test whether two regression slope coefficients from two linear models on
independent data sets are significantly different. I'm a bit concerned,
because when I test it on simulated data with different sample sizes and
variances, the function seems to be extremely sensitive both of these. I am
wondering if
2005 Mar 09
1
multiple comparisons for lme using multcomp
Dear R-help list,
I would like to perform multiple comparisons for lme. Can you report to me
if my way to is correct or not? Please, note that I am not nor a
statistician nor a mathematician, so, some understandings are sometimes
quite hard for me. According to the previous helps on the topic in R-help
list May 2003 (please, see Torsten Hothorn advices) and books such as
Venables &
2006 May 06
2
How to test for significance of random effects?
Dear list members,
I'm interested in showing that within-group statistical dependence is
negligible, so I can use ordinary linear models without including random
effects. However, I can find no mention of testing a model with vs.
without random effects in either Venable & Ripley (2002) or Pinheiro and
Bates (2000). Our in-house statisticians are not familiar with this,
either,
2006 Nov 30
1
data.frame within a function (PR#9294) (cont'd)
This continues the message "data.frame within a function (PR#9294)" that
was posted on 2006/10/12. Duncan Murdoch kindly replied. I'm using the
current version R 2.4.0, but the same issue exists. Just copy and paste
the following code under R, and compare the output of f1() and f2() and
the output of f3() and f4(). Does anybody have any idea? Thanks.
2008 Sep 17
2
Command Prompt Question
Could someone please tell me how to stop the package/function name from
being included before the command prompt? This started happening today
after I made some changes to my Rprofile.site file and I don't know why.
For example: if I enter example(AIC), instead of just getting the
regular '>' before each output line, I get 'AIC>' instead. I only want
the '>'
2010 Aug 17
2
AIC in MuMIn
Hello,
I am using package MuMIn to calculate AIC for a full model with 10
explanatory variables.
Thanks in advance in sharing your experience.
Q1
In the AIC list of all models, each model is differentiated by model number.
Please kindly advise if it is possible to
find the corresponding explanatory variable(s) for the model number.
Q2 error message
I tried to display sub-model with only
2012 May 22
1
Adding Text to a Plot
Hi, all!
I'm pretty sure I'm missing something about this.
Is there a smart way of typping hat(R)^2 and it's value from a linear
regression?
I've just found this tricky one:
# Sample data
x <- sample(1:100,10)
y <- 2+3*x+rnorm(10)
# Run the regression
lm1 <- lm(y~x)
# Plotting
plot(x,y, main="Linear Regression", col="red")
2005 May 31
2
simple predict question
Excuse the simple question...
I'm not sure what I'm doing wrong with predict, but let me use this example:
Suppose I do:
dat<-matrix(c(0,0,10,20),2,byrow=T)
lm1<-lm(dat[,2]~dat[,1])
Suppose I want to generate the linearly-interpolated y-values between the
point (0,0) and (0,20) at every unit interval.
I thought I just do:
predict(lm1, data.frame(seq(0,10,1))) to get
2010 Jun 17
1
Problems using allEffects() (package effect)
Dear R users,
I have some trouble using the allEffects() function to compute and
display effect plots for a linear model.
My data is quite simple, it concerns effects of 3 treatments on the
tumoral volume of mice. vTum codes for the qualitative initial volume,
from small to big, temps is the time in month since beginning of
treatment, and S?rie codes for the batch. Data is unbalanced.
>
2010 Apr 08
2
Overfitting/Calibration plots (Statistics question)
This isn't a question about R, but I'm hoping someone will be willing
to help. I've been looking at calibration plots in multiple regression
(plotting observed response Y on the vertical axis versus predicted
response [Y hat] on the horizontal axis).
According to Frank Harrell's "Regression Modeling Strategies" book
(pp. 61-63), when making such a plot on new data
2007 Apr 02
2
Why does lmList() fail when lm() doesn't?
Dear r-helpers,
Can anyone suggest why lm() doesn't complain here:
summary(osss.lm1 <- lm(logOdds ~ c.setSize %in% task, data = osss))
whereas in package:nlme (and in package:lme4)
osss.lmL <- lmList(logOdds ~ c.setSize %in% task | subj, data = osss)
# Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
# contrasts can be applied only to factors with 2 or more