14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

80 CHAPTER 11. GENERALIZED LINEAR MIXED MODEL ANALYSES<br />

reduce the step size if the residual log quasi-likelihood decreases by more than 1.e − 4. If the second<br />

argument is zero, then the stopping criteria is EPSILON (the default value of EPSILON is 1.e − 14) and it<br />

does not reduce the step size when the log likelihood increases. The EPSILON parameter can be set using<br />

this.parameter("EPSILON",value). M.vce aireml() returns a nr×(nr+1) matrix, where nr is the number<br />

of variance components. The first column of the matrix contains the estimated variance components. The<br />

remaining columns of the matrix contains the asymptotic covariance matrix.<br />

The M.info() is similar to M.save() except it does not include the estimated fixed effects or predicted<br />

random effects. The resulting file dose r.info:<br />

some extra information in the model<br />

--------------------------------------------------------<br />

AI REML converged<br />

maximum log restricted likelihood = -297.196<br />

variance for rep =<br />

0.801036<br />

residual variance =<br />

1<br />

MME dimension : 11<br />

non-zeros in MME: 52<br />

basic statistics for dependent variables<br />

-----------------------------------------------------<br />

trait-name n mean std<br />

perc_pos 70 0.371429 0.348139<br />

--------------------------------------------------------<br />

The residual log quasi-likelihood can also be obtained using M.residual log like().<br />

11.2.1 Correlated random effects<br />

In the previous example, it was assumed that the only effect of blocks was a change in the intercept. An<br />

alternative model would also allow the slope to change also. In the following <strong>Matvec</strong> code a random block<br />

by logdose is added to the model.<br />

M=Model();<br />

M.equation("perc pos=intercept formul logdose formul*logdose rep"+\<br />

"rep*logdose");<br />

M.covariate("logdose");<br />

M.weight("n");<br />

M.variance("rep",2);<br />

M.variance("rep*logdose",.1);<br />

M.link("logit",0)<br />

M.fitdata(D);<br />

However, the random intercept and random slope may be correlated. M.variance(effect 1,effect 2,covariance)<br />

2 is used to designate that the random effects are correlated. The complete <strong>Matvec</strong> code is now:<br />

D=Data();<br />

D.input("dose_r.dat","rep formul $ logdose n npos perc pos");<br />

M=Model();<br />

M.equation("perc pos=intercept formul logdose formul*logdose rep"+\<br />

" rep*logdose");<br />

M.covariate("logdose");<br />

2 Correlated random effects do not require a link function.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!