Re: [R] Plotting the result of a gamm in lattice

2014-03-29 Thread el_alisio
Hi Stefano,

first of all, it would be really helpful, if you provided a reproducible
example. That way we could better help you!! Second of all, please have a
look at ?gamm before posting a question:

Returns a list with two items:

gam 
an object of class gam, less information relating to GCV/UBRE model
selection. At present this contains enough information to use predict,
summary and print methods and vis.gam, but not to use e.g. the anova method
function to compare models.

lme 
the fitted model object returned by lme or gammPQL. Note that the model
formulae and grouping structures may appear to be rather bizarre, because of
the manner in which the GAMM is split up and the calls to lme and gammPQL
are constructed.

So, what you might want to try, is:

P1 <- predict(M1$gam,
   newdata = MD,
   se = TRUE,
   type = "link") 

However, I am not an expert in using GAMMs, so be careful with what you are
doing and do have a look at the residuals. You might also want to think
about including your random effect as a categorial variable in a "simple"
GAM, this way you could avoid the random effect structure (depends a bit on
the degrees of freedoms the categorial variable might consume and how many
observations you have). Anyhow, be careful and remember (cited again from
?gamm):

gamm assumes that you know what you are doing!

Cheers, 

Jannes




--
View this message in context: 
http://r.789695.n4.nabble.com/Plotting-the-result-of-a-gamm-in-lattice-tp4687568p4687823.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Nested boxplot groups

2014-03-29 Thread el_alisio
Hi,

a reproducible example would help us to help you. In any case, you might
want to consider a for-loop in combination with par(mfrow = c(?, ?)). The
lattice or ggplot2 package might also provide a solution to your problem.

Cheers,

Jannes



--
View this message in context: 
http://r.789695.n4.nabble.com/Nested-boxplot-groups-tp4687818p4687820.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Include Random Effects in Poisson Regressing (Nested Data)

2014-03-29 Thread el_alisio
Hi,

one way to include a random effect would be:

require("lme4")
mymodel <- lmer(counts ~ Season + Rainfall + (1 | Year), family =
quasipoisson,  data = mydata) 

Nevertheless, there are other ways to include a random effect using R. 

In any case, you need to provide justification why you are using a
quasipoisson method as this is just a quick-and-dirty solution for
overdispersion. Furthermore, there have been already various discussions on
random effects and poisson models. Please have a look at them before posting
a comment. Additionally, there are some excellent books on mixed-effects
models with R (e.g., Zuur et al., 2009).

Cheers, 

Jannes



--
View this message in context: 
http://r.789695.n4.nabble.com/Include-Random-Effects-in-Poisson-Regressing-Nested-Data-tp4687737p4687819.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lattice change font of one specific axis label in each panel

2014-03-27 Thread el_alisio
Hi Kevin,

thanks for the advice! The code is now reproducible. Sorry!

Actually I wanted to print only one x-label ("All Postdoctorates") in bold
face, not all of them. This would be easily achieved, if "All
Postdoctorates" appeared always in the same row of each panel, but this is
not the case here.

Cheers, 

Jannes



--
View this message in context: 
http://r.789695.n4.nabble.com/lattice-change-font-of-one-specific-axis-label-in-each-panel-tp4687638p4687663.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] lattice change font of one specific axis label in each panel

2014-03-27 Thread el_alisio
Dear R-users,

I would like to change the font of one specific axis label to bold face in
each panel. Taking one of Deepayan's plots as an example, how do I change
"All Postdoctorates" to bold face?

dotplot(prop.table(postdoc, margin = 1), groups = FALSE, index.cond =
function(x, y) median(x), xlab = "Proportion", layout = c(1, 5), aspect =
0.6, scales = list(y = list(relation = "free", rot = 0)), prepanel =
function(x, y) { list(ylim = levels(reorder(y, x))) }, panel = function(x,
y, ...) { panel.dotplot(x, reorder(y, x), ...) })

Thank you very much for your help in advance, I truly appreciate it!

Jannes



--
View this message in context: 
http://r.789695.n4.nabble.com/lattice-change-font-of-one-specific-axis-label-in-each-panel-tp4687638.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.