[R-sig-ME] new "Generalized Linear Mixed Models" book - #2

Carl Von Ende cvonende at niu.edu
Sun Mar 3 06:32:46 CET 2013


A 2nd new GLMM book, in fact, Walter Stroup is 2nd author; haven't
examined other than Table of Contents, on Amazon. 

Analysis of Generalized Linear Mixed Models in the Agricultural and
Natural Resources Sciences (Edward G. Gbur, et al.; ISBN-10:
0891181822). 

Carl von Ende

>>> <r-sig-mixed-models-request at r-project.org> 3/2/2013 9:00 PM >>>
Send R-sig-mixed-models mailing list submissions to
r-sig-mixed-models at r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
or, via email, send a message with subject or body 'help' to
r-sig-mixed-models-request at r-project.org

You can reach the person managing the list at
r-sig-mixed-models-owner at r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-mixed-models digest..."


Today's Topics:

   1. New book "Generalized Linear Mixed Models" by WalterStroup
      (Douglas Bates)
   2. updated sourceforge repository (Ben Bolker)
   3. Re: False convergence (Ben Bolker)
   4. Re: glmmADMB troubles (Ben Bolker)
   5. data grouping and fitting mixed model with lme function
      (KAYIS Seyit Ali)


----------------------------------------------------------------------

Message: 1
Date: Sat, 2 Mar 2013 10:51:38 -0600
From: Douglas Bates <bates at stat.wisc.edu>
To: R-mixed models mailing list  
 [R-sig-ME] New book "Generalized Linear Mixed Models" by
WalterStroup
Message-ID:
<CAO7JsnQ4Xqu7YL8jsZ650YofeyJ7koPA_Uwyj=2F=j6MYjMH9Q at mail.gmail.com>
Content-Type: text/plain

I just received a copy of this book (ISBN: 978-1-4398-1512-0) and am
very
favorably impressed - except for his using SAS PROC GLMMIX and for
writing
really long tedious equations for calculations that can be much more
succinctly expressed.

I would recommend to those subscribed to this list to read at least
the
preface and the introductory chapters 1 and 2.   He is quite eloquent
about
the harm caused by teaching the "X\beta + e" mindset that causes so
much
confusion as one tries to extend the linear regression model to other
forms.  His idea of starting with the generalized linear mixed model
framework and showing how it specializes to other forms is absolutely
the
way to go.  One of his suggestions is to start statistics graduate
students
on the general form so that you don't teach them concepts they will
later
need to unlearn and, again, I agree wholeheartedly with him.

I have only skimmed a few chapters and am quite confident that I will
find
parts with which I disagree but on balance I think it is a big step
forward.

[[alternative HTML version deleted]]



------------------------------

Message: 2
Date: Sat, 02 Mar 2013 13:15:21 -0500
From: Ben Bolker <bbolker at gmail.com>
To: "r-sig-mixed-models at r-project.org"
<r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] updated sourceforge repository
Message-ID: <513241B9.3020404 at mcmaster.ca>
Content-Type: text/plain; charset=ISO-8859-1

I have just pushed updated source, Windows 64-bit binary, and MacOS
binaries of the very most current development version of lme4,
0.99999911-1, to the repository at

http://lme4.r-forge.r-project.org/repos/src/contrib/ ;

**however, it will take up to 24 hours for the web pages to update (so
you won't see the new version right away**.

  You should thereafter be able to

install.packages("lme4",
repos=c("http://lme4.r-forge.r-project.org/repos",
         getOption("repos")))

Please e-mail lme4-authors at R-forge.wu-wien.ac.at if you have problems
with this.

To install the most recent version directly from github (where
development is now proceeding),

library("devtools")
install_github("lme4",user="lme4")

(you will need the Rcpp, RcppEigen, and minqa packages installed
first)

  Ben Bolker



------------------------------

Message: 3
Date: Sat, 2 Mar 2013 21:34:59 +0000 (UTC)
From: Ben Bolker <bbolker at gmail.com>
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] False convergence
Message-ID: <loom.20130302T220905-476 at post.gmane.org>
Content-Type: text/plain; charset=utf-8

Nick Isaac <njbisaac at ...> writes:

> Dear list,
>
> I'm running a set of models in glmer(), some of which return the
'false
> convergence' error (cvg=8). I'm trying to understand why.
>
> My models all have the same basic structure: glmer(P ~ Year +
(1|Site),
> binomial), where P is a vector of 0s and 1s. The Year is centered on
zero,
> which I've found to greatly reduce the incidence of false
convergences in
> the past. There are ~100,000 observations and 9000 sites.
>
> I've tried a couple of fixes, including the .Call("mer_optimize",...)
hack
> as well as an observation-level random effect. the former has no
impact on
> the parameter estimates and the latter still returns the false
convergence
> warning.
>
> I'm using verbose=T argument. I've noticed previously that false
> convergence is characterised by just 1 or 2 iterations being
completed and
> variances on the random effects that are either close to zero or
> astronomically huge. But my models are running to dozens of
iterations with
> sensible looking variances that change moderately among iterations
but then
> stabilise during the last few iterations. And the parameter estimates
look
> sensible.
>
> In other words, the models do not show any evidence of failure,
except the
> warning message. So which should I believe: the verbose trace or the
> warning message?
>
> Perhaps someone can give me further insight into why glmer() thinks
the
> model has not properly converged

  In general I would believe the verbose trace ...

  The stable version of lme4 is using the nlminb() optimizer
internally,
which in turn is based on the PORT libraries

The docs linked from ?nlminb:

http://netlib.bell-labs.com/cm/cs/cstr/153.pdf

The only useful material I could find in these docs was:

------------
p. 5: false convergence: the gradient ?f(x) may be computed
incorrectly, the other stopping tolerances may be too tight, or either
f or ?f may be discontinuous near the current iterate x.

p. 9: V(XFTOL) ? V(34) is the false-convergence tolerance. A return
with IV(1) = 8 occurs if a more favorable stopping test is not
satisfied and if a step of scaled length at most V(XFTOL) is tried but
not accepted. ??Scaled length?? is in the sense of (5.1). Such a
return generally means there is an error in computing ?f(x), or
the favorable convergence tolerances (V(RFCTOL), V(XCTOL), and
perhaps V(AFCTOL)) are too tight for the accuracy to which f(x) is
computed (see ?9), or ?f (or f itself) is discontinuous near x . An
error in computing ?f(x) usually leads to false convergence after
only a few iterations ? often in the first.  Default = 100*MACHEP.

p. 13: Sometimes evaluating f(x) involves an extensive computation,
such as performing a simulation or adaptive numerical quadrature or
integrating an ordinary or partial differential equation. In such
cases the value computed for f (x), say f?( x ), may involve
substantial error (in the eyes of the optimization algorithm).  To
eliminate some ??false convergence?? messages and useless function
evaluations, it is necessary to increase the stopping tolerances and,
when finite-difference derivative approximations are used, to increase
the step-sizes used in estimating derivatives.
----------

"evaluating f(x) involves an extensive computation" is a reasonably
good description of what's going on inside lme4 (although I think the
internal computations are _slightly_ less involved/noisy than a
typical ODE solution or generic integration by quadrature).

Are all of your covariates (year, site) unique, or can you collapse
the data to a binomial variable?  That might help a lot with both
speed and stability, and should be functionally equivalent ...

Observation-level random effects should have essentially no effect
for a Bernoulli variable.

nlminb() is notoriously cryptic/sensitive: it might be worth
checking the development version of lme4, which uses a more
robust optimizer by default (although you can also use nlminb(),
for backward comparison) and allows more control/investigation
of the optimization.

  Ben Bolker



------------------------------

Message: 4
Date: Sat, 02 Mar 2013 18:04:15 -0500
From: Ben Bolker <bbolker at gmail.com>
To: Ross Boylan <ross at biostat.ucsf.edu>
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] glmmADMB troubles
Message-ID: <5132856F.4080805 at gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On 13-02-28 01:15 PM, Ross Boylan wrote:
> On 2/27/2013 8:05 PM, Ben Bolker wrote:
>> Ross Boylan <ross at ...> writes:
>>
>>> It seems it's one thing after another.  Ben suggested glmmADMB for
>>> poisson--actually for truncated poisson, but for now I'm just
trying to
>>> get anything going.  Some of my count variables have 1, not 0 as a
>>> minimum, and some have a maximum too, e.g., all values >10 are
reported
>>> as 10.
>>    If you have enough data to make it worthwhile, you might try the
>> 'ordinal' package ...
> Thanks for the pointer.  Does it make the proportional odds
assumption?
>>
>>> I was able to install it from r-forge, with a warning that it was
build
>>> for 2.15.3.  But ...
>>>

  [snip]

>>> Figuring that its missing value handling might be off,

  Yes. I might be able to fix the NA-handling, but given that I am
fairly sure that this error means an NA problem, I have taken the lazy
way out and advised the user that this means they have to deal with
NAs
themselves.

>> I tried
>>> removing the
>> missing values:
>>>> r <- glmmadmb(sexActs~(1|id),
sexpartner[!is.na(sexpartner$sexActs),])
>>> Error in system(cmd, intern = intern, wait = wait | intern,
>> show.output.on.console = wait,  :
>>>     'C:/Program' not found
>>>> traceback()
>>> 4: system(cmd, intern = intern, wait = wait | intern,
>>> show.output.on.console =
>> wait,
>>>          ...)
>>> 3: shell(cmd, invisible = TRUE, intern = !verbose)
>>> 2: run_bin(platform, bin_loc, file_name, cmdoptions, run, rm_binary
=
>> !use_tmp_dir,
>>>          debug = debug, verbose = verbose)
>>> 1: glmmadmb(sexActs ~ (1 | id),
sexpartner[!is.na(sexpartner$sexActs),
>>>          ])
>>     Hmmm.  Can you give
>>
>> * the results of sessionInfo()
>> * the results of trying your command with debug=TRUE ?
>> * the results of glmmADMB:::get_bin_loc() ?
>>
>>   Ben Bolker
>>
>>
> I wasn't sure which command you wanted trace, and so I did both:
>
>> library(glmmADMB)
> Loading required package: MASS
> Loading required package: R2admb
>
> Attaching package: 'glmmADMB'
>
> The following object(s) are masked from 'package:MASS':
>
>     stepAIC
>
> The following object(s) are masked from 'package:lme4':
>
>     fixef, ranef
>
> The following object(s) are masked from 'package:stats':
>
>     step
>
> Warning message:
> package 'glmmADMB' was built under R version 2.15.3
>> sessionInfo()
> R version 2.15.2 (2012-10-26)
> Platform: i386-w64-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] glmmADMB_0.7.4  R2admb_0.7.5.3  MASS_7.3-22     lme4_0.999999-0
> [5] Matrix_1.0-10   lattice_0.20-10
>
> loaded via a namespace (and not attached):
>  [1] colorspace_1.2-0   compiler_2.15.2    dichromat_1.2-4   
digest_0.6.0
>  [5] ggplot2_0.9.3      grid_2.15.2        gtable_0.1.2      
labeling_0.1
>  [9] munsell_0.4        nlme_3.1-106       plyr_1.8          
proto_0.3-10
> [13] RColorBrewer_1.0-5 reshape2_1.2.2     scales_0.2.3      
stats4_2.15.2
> [17] stringr_0.6.2      tools_2.15.2

  [snip: not including version without NAs removed, since we already
know what the issue is there]

>> r <- glmmadmb(sexActs~(1|id),
sexpartner[!is.na(sexpartner$sexActs),],
>> debug=TRUE)
> platform: windows 32
> executable name: glmmadmb.exe
> bin_loc:
>
c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe
>
> using temp directory
> C:\Users\rdboylan\AppData\Local\Temp\Rtmpy2JsMY\glmmADMB17085c19f4d
> creating temp directory
> changed working directory to
> C:/Users/rdboylan/AppData/Local/Temp/Rtmpy2JsMY/glmmADMB17085c19f4d
> Command line:
>
"c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe"
> -maxfn 500 -maxph 5 -noinit -shess
> Error in system(cmd, intern = intern, wait = wait | intern,
> show.output.on.console = wait,  :
>   'C:/Program' not found

  I'm a little bit baffled here.  What happens if you use save.dir to
save the input files to a temporary directory and run

"c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe"
-maxfn 500 -maxph 5 -noinit -shess

from the command line?

What is the result of .Platform (and .Platform$OS in particular)

It looks conceivably like R is misdiagnosing your system as *not*
being
windows, as that's the only way system() should be running.  Are you
running under Cygwin (you say it's installed below) ...  ?

> changed working directory to i:/LAMOC/Ross
> removed temp directory
> C:\Users\rdboylan\AppData\Local\Temp\Rtmpy2JsMY\glmmADMB17085c19f4d
>> glmmADMB:::get_bin_loc()
> $bin_loc
> [1]
>
"c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe"
>
>
> $platform
> [1] "windows"
>
> P.S. about lme4; I don't have a build environment and so trying the
> github version will not be my first move.
> Although perhaps lack of a build environment is why the second
version
> is failing.  I do have cygwin installed, althoughI would not expect R
to
> know how to find it.

  lme4 should be installable from lme4.r-forge.r-project.org/repos
now,
as stated in a message earlier today.



------------------------------

Message: 5
Date: Sat, 2 Mar 2013 19:00:26 -0800 (PST)
From: KAYIS Seyit Ali <s_a_kayis at yahoo.com>
To: "r-sig-mixed-models at r-project.org"
<r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] data grouping and fitting mixed model with lme
function
Message-ID:
<1362279626.41184.YahooMailNeo at web160102.mail.bf1.yahoo.com>
Content-Type: text/plain

Dear all,
 
I have data from the following experimental design and trying to fit a
mixed model with lme function according to following steps but
struggling. Any help is deeply appreciated.
 
1) Experimental design: I have 40 plants each of which has 4 clones.
Each clone planted to one of 4 blocks. Phenotypes were collected from
each clone for 3 consecutive years. I have genotypes of plants. I need
to relate phenotype to genotype.
 
2) I am reading data from a file with “read.table† function. Then
grouping data as: my.Data<-groupedData( phenotype ~ Block | PlantID,
data = as.data.frame( Data ) )
 
3) I want to fit Genotype + Year + Genotype:Year as fixed effect. Block
+ PlantID + Block.PlantID as random effect.
 
I feel my data grouping is incorrect as model fitting do not work
properly.
 
Some part of my data was added below in case it would help to
understand the structure.
 
Any help regarding data grouping and model fitting is deeply
appreciated.
 
Kind Regards
 
Seyit Ali
 
 
PlantID Block Year Diameter Genotype
1 1 1 170 0
1 2 1 166 0
1 3 1 168 0
1 4 1 169 0
1 1 2 142 0
1 2 2 115 0
1 3 2 131 0
1 4 2 129 0
1 1 3 138 0
1 2 3 142 0
1 3 3 139 0
1 4 3 135 0
2 1 1 155 1
2 2 1 168 1
2 3 1 158 1
2 4 1 145 1
2 1 2 131 1
2 2 2 150 1
2 3 2 130 1
2 4 2 130 1
2 1 3 123 1
2 2 3 125 1
2 3 3 126 1
2 4 3 129 1
3 1 1 142 0
3 2 1 155 0
3 3 1 150 0
3 4 1 149 0
3 1 2 123 0
3 2 2 129 0
3 3 2 134 0
3 4 2 131 0
3 1 3 126 0
3 2 3 117 0
3 3 3 123 0
3 4 3 126 0
4 1 1 167 0
4 2 1 156 0
4 3 1 161 0
4 4 1 164 0
4 1 2 148 0
4 2 2 133 0
4 3 2 144 0
4 4 2 127 0
4 1 3 137 0
4 2 3 134 0
4 3 3 135 0
4 4 3 135 0
5 1 1 146 1
5 2 1 156 1
5 3 1 152 1
5 4 1 147 1
5 1 2 122 1
5 2 2 131 1
5 3 2 132 1
5 4 2 130 1
5 1 3 127 1
5 2 3 126 1
5 3 3 130 1
5 4 3 136 1
6 1 1 148 0
6 2 1 161 0
6 3 1 140 0
6 4 1 150 0
6 1 2 123 0
6 2 2 130 0
6 3 2 120 0
6 4 2 134 0
6 1 3 123 0
6 2 3 132 0
6 3 3 128 0
6 4 3 128 0
7 1 1 152 1
7 2 1 147 1
7 3 1 153 1
7 4 1 170 1
7 1 2 124 1
7 2 2 130 1
7 3 2 135 1
7 4 2 128 1
7 1 3 128 1
7 2 3 129 1
7 3 3 129 1
7 4 3 129 1
8 1 1 141 0
8 2 1 129 0
8 3 1 135 0
8 4 1 138 0
8 1 2 117 0
8 2 2 124 0
8 3 2 121 0
8 4 2 127 0
8 1 3 124 0
8 2 3 125 0
8 3 3 123 0
8 4 3 121 0
9 1 1 150 1
9 2 1 153 1
9 3 1 147 1
9 4 1 148 1
9 1 2 135 1
9 2 2 131 1
9 3 2 133 1
9 4 2 135 1
9 1 3 130 1
9 2 3 130 1
9 3 3 129 1
9 4 3 128 1
10 1 1 152 1
10 2 1 143 1
10 3 1 148 1
10 4 1 150 1
10 1 2 134 1
10 2 2 128 1
10 3 2 133 1
10 4 2 132 1
10 1 3 129 1
10 2 3 133 1
10 3 3 129 1
10 4 3 130 1


------------------------------------------------------------------------
Dr. Seyit Ali KAYIS
Selcuk University, Faculty of Agriculture
Kampus/Konya, Turkey



Tel: +90 332 223 2830 Mobile: +90 535 587 1139


Greetings from Konya, Turkey
http://www.ziraat.selcuk.edu.tr/skayis/
------------------------------------------------------------------------


________________________________
[[alternative HTML version deleted]]



------------------------------

_______________________________________________
R-sig-mixed-models mailing list
R-sig-mixed-models at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


End of R-sig-mixed-models Digest, Vol 75, Issue 6
*************************************************


More information about the R-sig-mixed-models mailing list