10,426 reputation
12759
bio website fromthebottomoftheheap.net
location Regina, Canada
age 37
visits member for 3 years, 11 months
seen 5 mins ago

I'm Quantitative Environmental Scientist in the Institute of Environmental Change & Society, at the University of Regina, Canada. I undertake research on environmental problems, including climate change and atmospheric pollution, affecting lakes. I use lake sediments to look back in time at the history of lakes to look at what organisms are present and how the species in the lake have changed through time and how lakes evolve and respond to pollution and perturbations.

I'm also an Adjunct Professor in the Department of Biology at the University of Regina.


14h
comment How to use one variable in regression with many independent variables in lm()
I've voted to close (and migrate to Stack Overflow) because this is really a question about R. That said, there are some interesting statistical issues here, not least the fact that you are looking into your data when deciding which variables to include in the model.
Aug
25
comment Sum to Zero Constraint GAM Factor Interaction
Read section 4.3 in Simon's book (p169-170). It discusses the sum-to-zero constraint and explicitly references the model matrix, not the "terms" component. The constraint is $\mathbf{1^{T}\tilde{X}_j\tilde{\beta}_j} = 0$ and some re-parameterisation is done to absorb this constraint into the model matrix. So when looking at this you need to include the model matrix and the coefficient vector. But I am struggling to get the correct bits out of mod2 to illustrate this. You may want to email Simon again and post an Answer here if he replies (or ask him if he wants to do it himself?).
Aug
25
comment Sum to Zero Constraint GAM Factor Interaction
Will add a fuller answer tomorrow when i recall the details, but the missing info in your by smoother is that you need to add fac as a fixed effects term to the model as well as the by variable. I will guess that adding that will improve things.
Aug
21
awarded  Nice Answer
Aug
14
comment Introductory Text for GAM
@patrick I assumed this would be closed as not having one or just a couple of answers
Aug
11
answered Testing slopes in multivariate adaptive regression splines (MARS/earth)
Aug
6
awarded  Nice Answer
Aug
1
comment Introductory Text for GAM
I would go with Simon Wood's Generalised Additive Models: an introduction with R. Even though mgcv has moved on a lot from what was used in this book (See citation(package = "mgcv") for some of the more recent proper papers on the methods), this remains one of the best books I know for learning about GAMs (and GLMs) with a practical side in R and a theoretical side.
Jul
29
awarded  Guru
Jul
29
comment Non-significant factors after stepwise regression
Do you mean some levels of one or more factors are not significant in the output from summary(model)? Stepwise methods should rightly work on the amount of variance (expressed in one of a number of ways) explained by an entire term - i.e. over all levels of a factor. Some levels may not be significant but one or more levels will be. However, what you can infer from the $t$ stats and their p-values in that summary output is limited owing to multiple testing (one per $t$) and, more importantly the inherent problems of stepwise procedures which render the $p$ values largely uninformative.
Jul
2
accepted Determine which method predicts best given results from a simulation exercise
Jul
2
awarded  Curious
Jun
21
comment Does lots of bias==underfitting, while lots of variance==overfitting?
I've seen high variance models described as unstable (or more specifically the model estimates are unstable).
Jun
21
revised Does lots of bias==underfitting, while lots of variance==overfitting?
vari*a*nce
Jun
20
comment Interpret the effect of factor in GAMM
You have shown no evidence for me to decide which is a better model. You can look at the AIC/BIC of the models, & look at the residuals; plot them by Site to see if there is a Site effect. (I only suggested one way in which you might get the above plot differences.) I'm not sure about the random effect specification; I think you have it right but I don't use that list form often enough to be sure. You might consider the gamm4 package, also by Simon Wood, which uses the lme4 pkg (instead of nlme) to fit the GAMM & which has easier ways to specify the random effects terms.
Jun
20
comment Interpret the effect of factor in GAMM
These are partial plots, so they show the effect of Cover whilst holding the other variables at their mean or baseline level. gamm() is doing (RE)ML smoothness selection for you as the smoothness penalties are part of the random effects of the model; hence once Site is accounted for, the optimal model according to the (RE)ML criterion is to shrink the smooth function for cover to a linear function using 1 df. I suspect that there is a "Site" effect in the first plot that confounds with Cover, hence a more complex fit seems to do better initially.
Jun
17
answered Extract (ultrametric) distances from hclust or dendrogram
Jun
12
comment Predicting time series with OpenBUGS
I think you may be confusing the value of $y_i$ with the AR(1) parameter. The AR(1) parameter ($b_1$) indicates what proportion of the information from $y_{i-1}$ propagates to $y_i$, then you add the constant term ($b_0$). If all the series were centred, then they'd all have mean zero and $b_0$ would be 0 leaving you just the AR(1) parameter plus Gaussian noise. Hence, for series with values between the ones you state, don't you want the wider prior on $b_0$ and leave the AR(1), $b_1$, at the (-1, 1) prior suggested.
Jun
12
comment Predicting time series with OpenBUGS
@peter The prior is incorporated with the answer here. You state that you don't want the series to "grow exponentially". For the AR(1) that implies a stationary model and hence you are using that prior information to indicate that you don't know what the value of $b_1$ is but it should be between -1 and 1 To satisfy the stationarity requirement.
Jun
11
comment Interaction in logistic models with R. Using * operator or create an interaction variable?
@Bakaburg If you make no the reference level for ART.conc then you should be able to do this as Intercept + the two main effects + the interaction. R is doing for you what interaction() does, the problem seems more related to having estimates for the quantities of interest, which can be controlled by setting appropriate reference categories, no?