similar to: Bayesian logistic regression?

Displaying 20 results from an estimated 3000 matches similar to: "Bayesian logistic regression?"

2006 Jan 10
2
lmer(): nested and non-nested factors in logistic regression
Thanks to some help by Doug Bates (and the updated version of the Matrix package), I've refined my question about fitting nested and non-nested factors in lmer(). I can get it to work in linear regression but it crashes in logistic regression. Here's my example: # set up the predictors n.age <- 4 n.edu <- 4 n.rep <- 100 n.state <- 50 n <- n.age*n.edu*n.rep age.id
2006 Jul 12
1
Prediction interval of Y using BMA
Hello everybody, In order to predict income for different time points, I fitted a linear model with polynomial effects using BMA (bicreg(...)). It works fine, the results are consistent with what we are looking for. Now, we would like to predict income for a future time point t_next and of course draw the prediction interval around the estimated value for this point t_next. I've found the
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
2006 Feb 01
1
student-t regression in R?
Is there a quick way to fit student-t regressions (that is, a regression with t-distributed error, ideally with the degrees-of-freedom parameter estimated from the data)? I can do it easily enough in Bugs, or I can program the log-likelihood in R and optimize using optim(), but an R version (if it's already been written by somebody) would be convenient, especially for teaching purposes.
2007 Feb 11
2
problem with Matrix package
I decided to update my packages and then had a problem with loading the Matrix package http://cran.at.r-project.org/bin/windows/contrib/2.4/Matrix_0.9975-9.zip This is what happened when I tried to load it in: > library("Matrix") Error in importIntoEnv(impenv, impnames, ns, impvars) : object 'Logic' is not exported by 'namespace:methods' Error:
2006 May 02
2
evaluation of expressions
Hi, all. I'm trying to automate some regression operations in R but am confused about how to evaluate expressoins that are expressed as character strings. For example: y <- ifelse (rnorm(10)>0, 1, 0) sex <- rnorm(10) age <- rnorm(10) test <- as.data.frame (cbind (y, sex, age)) # this works fine: glm (y ~ sex + I(age^2), data=test, family=binomial(link="logit"),
2006 Jan 10
1
another question about lmer, this time involving coef()
I'm having another problem with lmer(), this time something simpler (I think) involving the coef() function for a model with varying coefficients. Here's the R code. It's a simple model with 2 observations per group and 10 groups: # set up the predictors n.groups <- 10 n.reps <- 2 n <- n.groups*n.reps group.id <- rep (1:n.groups, each=n.reps) # simulate the varying
2004 Feb 16
0
How do we obtain Posterior Predictive (Bayesian) P-values in R (a sking a second time)
Dear Friends, According to Gelman et al (2003), "...Bayesian P-values are defined as the probability that the replicated data could be more extreme than the observed data, as measured by the test quantity p=pr[T(y_rep,tetha) >= T(y,tetha)|y]..." where p=Bayesian P-value, T=test statistics, y_rep=data from replicated experiment, y=data from original experiment, tetha=the function
2006 May 01
3
pulling items out of a lm() call
I want to write a function to standardize regression predictors, which will require me to do some character-string manipulation to parse the variables in a call to lm() or glm(). For example, consider the call lm (y ~ female + I(age^2) + female:black + (age + education)*female). I want to be able to parse this to pick out the input variables ("female", "age",
2006 Feb 10
1
mcmcsamp shortening variable names; how can i turn this feature off?
I have written a function called mcsamp() that is a wrapper that runs mcmcsamp() and automatically monitors convergence and structures the inferences into vectors and arrays as appropriate. But I have run into a very little problem, which is that mcmcsamp() shortens the variable names. For example: > set.seed (1) > group <- rep (1:5,10) > a <- rnorm (5,-3,3) > y <-
2006 Aug 03
1
how to use the EV AND condEV from BMA's results?
Dear friends, In R, the help of "bic.glm" tells the difference between postmean(the posterior mean of each coefficient from model averaging) and condpostmean(the posterior mean of each coefficient conditional on the variable being included in the model), But it's still unclear about the results explanations, and the artile of Rnews in 2005 on BMA still don't give more detail on
2006 Jan 28
1
yet another lmer question
I've been trying to keep track with lmer, and now I have a couple of questions with the latest version of Matrix (0.995-4). I fit 2 very similar models, and the results are severely rounded in one case and rounded not at all in the other. > y <- 1:10 > group <- rep (c(1,2), c(5,5)) > M1 <- lmer (y ~ 1 + (1 | group)) > coef(M1) $group (Intercept) 1 3.1 2
2006 Jan 08
1
lmer with nested/nonnested groupings?
I'm trying to figure out how to use lmer to fit models with factors that have some nesting and some non-nested groupings. For example, in this paper: http://www.stat.columbia.edu/~gelman/research/published/parkgelmanbafumi.pdf we have a logistic regression of survey respondents' political preferences (1=Republican, 0=Democrat), regressing on sex, ethnicity, state (51 states within 5
2004 Feb 17
0
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
Dear friends, Over the past weeks, I have been asking a lot of questions about how to use R in Bayesian analysis. I am brand new to R, but I am very pleased with it. I started with winbugs but I found winbugs to be a limited software, not bad but has several limitations. By contrast, R allows the analyst to tackle any problem with a huge set of tools for any kind of analysis. I love R. In
2006 May 09
1
trying to use standard notation
Hi, all. In setting up my package for post-processing regression models, I am trying to use standard notation as much as possible: thus, I use coef() to access estimated coefficients. I wrote a function called se.coef() to grab standard errors, and se.fixef() and se.ranef() to grab se's from coefficients estimated from lmer(). I also need a function to access sigma-hat (the residual sd
2010 May 28
3
Gelman 2006 half-Cauchy distribution
Hi, I am trying to recreate the right graph on page 524 of Gelman's 2006 paper "Prior distributions for variance parameters in hierarchical models" in Bayesian Analysis, 3, 515-533. I am only interested, however, in recreating the portion of the graph for the overlain prior density for the half-Cauchy with scale 25 and not the posterior distribution. However, when I try:
2019 Dec 27
2
"simulate" does not include variability in parameter estimation
Hello, All: ????? The default "simulate" method for lm and glm seems to ignore the sampling variance of the parameter estimates;? see the trivial lm and glm examples below.? Both these examples estimate a mean with formula = x~1.? In both cases, the variance of the estimated mean is 1. ??? ??????? * In the lm example with x0 = c(-1, 1), var(x0) = 2, and
2004 Feb 12
1
How do you create a "MCMC" object?
I have been running a Gibbs Sampler to estimate levels of efficiency in the Louisiana Shrimp Industry. I created a matrix (samp) where I stored the results of each iteration for 86 variables. I run 10,000 iterations. So, the matrix samp is 10,000 x 86. I want to use the gelman-rubin test to check for convergence. To do that, I need at least two chains. If I run second chain with different starting
2006 May 20
5
Can lmer() fit a multilevel model embedded in a regression?
I would like to fit a hierarchical regression model from Witte et al. (1994; see reference below). It's a logistic regression of a health outcome on quntities of food intake; the linear predictor has the form, X*beta + W*gamma, where X is a matrix of consumption of 82 foods (i.e., the rows of X represent people in the study, the columns represent different foods, and X_ij is the amount of
2019 Dec 27
1
"simulate" does not include variability in parameter estimation
On 2019-12-27 04:34, Duncan Murdoch wrote: > On 26/12/2019 11:14 p.m., Spencer Graves wrote: >> Hello, All: >> >> >> ? ????? The default "simulate" method for lm and glm seems to ignore the >> sampling variance of the parameter estimates;? see the trivial lm and >> glm examples below.? Both these examples estimate a mean with formula = >>