Displaying 20 results from an estimated 200 matches similar to: "confidence bands for a quasipoisson glm"
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all
I have run into a case where I don't understand why predict.lrm and
predict.glm don't yield the same results. My data look like this:
set.seed(1)
library(Design); ilogit <- function(x) { 1/(1+exp(-x)) }
ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE))
CONJ <- factor(sample(c("als", "bevor", "nachdem",
2010 Apr 13
2
transpose but different
Hi all,
I want to make extra columns in my datafile where the id of every
groupmember is mentioned in separate columns. To explain it better see the
example:
id<-c(1,2,3,4,5,6,7,8,9,10,11,12)
group<-c(1,1,1,1,2,2,3,3,3,3,3,3)
a<-as.data.frame(cbind(id,group))
a
id group
1 1 1
2 2 1
3 3 1
4 4 1
5 5
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
Hello,
Any advice or pointers for implementing Sobel's test for mediation in
2-level model setting? For fitting the hierarchical models, I am using
"lme4" but could also revert to "nlme" since it is a relatively simple
varying intercept model and they yield identical estimates. I apologize for
this is an R question with an embedded statistical question.
I noticed that a
2017 Aug 10
0
Plotting log transformed predicted values from lme
Dear Alina
If I understand you correctly you cannot just have a single predicted
curve but one for each level of your factor.
On 09/08/2017 16:24, Alina Vodonos Zilberg wrote:
> Hi,
>
> I am performing meta-regression using linear mixed-effect model with the
> lme() function that has two fixed effect variables;one as a log
> transformed variable (x) and one as factor (y)
2017 Aug 09
3
Plotting log transformed predicted values from lme
Hi,
I am performing meta-regression using linear mixed-effect model with the
lme() function that has two fixed effect variables;one as a log
transformed variable (x) and one as factor (y) variable, and two nested
random intercept terms.
I want to save the predicted values from that model and show the log curve
in a plot ; predicted~log(x)
mod<-lme(B~log(x)+as.factor(y),
2017 Aug 10
1
Plotting log transformed predicted values from lme
Thank you Michael,
Curves for each level of the factor sounds very interesting,
Do you have a suggestion how to plot them?
Thank you!
Alina
*Alina Vodonos Zilberg*
On Thu, Aug 10, 2017 at 7:39 AM, Michael Dewey <lists at dewey.myzen.co.uk>
wrote:
> Dear Alina
>
> If I understand you correctly you cannot just have a single predicted
> curve but one for each level of your
2011 Jun 14
0
error message trying to plot survival curves from hypothetical covariate profiles
Dear colleagues,
following John Fox' advice in this article (http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf), I'm trying to create a new data frame to examine the differential survival curves from a combination of covariates.
These are derived from a Cox Proportional Hazards model I fit to data about the diffusion of a particular policy across American
2017 Mar 30
0
get_all_vars() does not handle rhs matrices in formulae
Hello again,
It appears that get_all_vars() incorrectly handles model formulae that
use a right-hand side (rhs) matrix. For example, consider these two
substantively identical models:
# model using named variables
mpg <- mtcars$mpg
wt <- mtcars$wt
hp <- mtcars$hp
m1 <- lm(mpg ~ wt + hp)
# model using matrix
y <- mtcars$mpg
x <- cbind(mtcars$wt, mtcars$hp)
m2 <- lm(y ~ x)
2004 Jan 08
3
Strange parametrization in polr
In Venables \& Ripley 3rd edition (p. 231) the proportional odds model
is described as:
logit(p<=k) = zeta_k + eta
but polr apparently thinks there is a minus in front of eta,
as is apprent below.
Is this a bug og a feature I have overlooked?
Here is the naked code for reproduction, below the results.
------------------------------------------------------------------------
---
version
2009 Feb 08
5
glmmBUGS: logistic regression on proportional data
Hello,
I am trying to run a logistic regression with random effects on
proportional data in glmmBUGS. I am a newcomer to this package, and
wondered if anyone could help me specify the model correctly.
I am trying to specify the response variable, /yseed/, as # of successes
out of total observations... but I suspect that given the error below,
that is not correct. Also, Newsect should be a
2011 Jun 24
2
mgcv:gamm: predict to reflect random s() effects?
Dear useRs,
I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting purposes which account for the random smooth components of the fit.
An example. (sessionInfo() is at
2008 Jul 09
2
sorting a data frame by rownames
Hi there,
I'm sure there's an easy answer to this, and I can't wait to see it.
The question: is there an easy way to sort a data frame by it's row names?
My dilemma:
I've had to pull apart a data frame, run it through a loop to do some
calculations and generate new variables, and then re-construct the chunks
back into a data frame at the end.
Doing this preserves the row
2012 Apr 18
3
normal distribution assumption for multi-level modelling
Hello,
I'm analysing reaction time data from a linguistic experiment (a variant of
a lexical decision task). To ascertain that the data was normally
distributed, I used *shapiro.test *for each participant (see commands
below), but only one out of 21 returns a p value above p.0 05.
> f = function(dfr) return(shapiro.test(dfr$Target.RTinv)$p.value)
> p = as.vector(by(newdat,
2012 Nov 30
0
Standard errors for predictions of zero-inflated models
Dear all,
I am using the zeroinfl() function from the pscl package to develop a zero-inflated Poisson GLM. I would like to calculate the standard errors of predicted values. I've tried code posted in a previous discussion on this topic (https://stat.ethz.ch/pipermail/r-help/2008-December/182806.html), and I don't understand the results. Before I apply this code, I get the predicted value
2011 Sep 08
1
predict.rma (metafor package)
Hi
(R 2.13.1, OSX 10.6.8)
I am trying to use predict.rma with continuous and categorical variables. The argument newmods in predict.rma seems to handle coviariates, but appears to falter on factors. While I realise that the coefficients for factors provide the answers, the goal is to eventually use predict.rma with ANCOVA type model with an interaction.
Here is a self contained example
2005 Mar 04
0
Need suggestions for finding dose response using nls
I am relatively new to R and am looking for advice, ideas or both...
I have a data set that consists of pathogen population sizes on
individual plant units in an experimental field plot. However, in
order to estimate the pathogen population sizes I had to destroy the
plant unit and could not determine if that plant unit became diseased
or to what extent it would have become diseased. I
2009 Mar 31
1
Can not get a prediction interval from Predict
I am trying to get a prediction interval from a glm regression.
With newdat being my set of values to be fitted, and glmreg the name of my
regression, I am using the following code.
predict(glmreg, newdat, se.fit = TRUE, interval = "confidence", level =
0.90)
The problem is that I am only getting the standard error and the fitted
value, not a prediction interval.
Any help would be
2017 Jun 12
0
plotting gamm results in lattice
Hi Maria
If you have problems just start with a small model with predictions and then plot with xyplot
the same applies to xyplot
Try
library(gamm4)
spring <- dget(file = "G:/1/example.txt")
str(spring)
'data.frame': 11744 obs. of 11 variables:
$ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 ...
$ SITE_ID
2007 Feb 01
2
Losing factor levels when moving variables from one context to another
Hi, there
I'm currently trying to figure out how to keep my "factor" levels for a
variable when moving it from one data frame or matrix to another.
Example below:
vec1<-(rep("10",5))
vec2<-(rep("30",5))
vec3<-(rep("80",5))
vecs<-c(vec1, vec2, vec3)
resp<-rnorm(2,15)
dat<-as.data.frame(cbind(resp, vecs))
2010 Aug 13
1
loop for inserting rows in a matrix
Dear R friends,
I have a matrix with 2060 rows and 41 columns. One column is Date, another is Transect, and another is Segment. I want to ensure that there are 9 Transects (1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the matrix, by inserting rows where these are missing.
I am new to coding, but am trying to write a loop which checks if each of the transects already