epil.html

来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 105 行

HTML
105
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Seizure Counts for Epileptics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for epil {MASS}"><tr><td>epil {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Seizure Counts for Epileptics</h2>


<h3>Description</h3>

<p>
Thall and Vail (1990) give a data set on two-week seizure counts for
59 epileptics.  The number of seizures was recorded for a baseline
period of 8 weeks, and then patients were randomly assigned to a
treatment group or a control group.  Counts were then recorded for
four successive two-week periods. The subject's age is the only
covariate.
</p>


<h3>Usage</h3>

<pre>
epil
</pre>


<h3>Format</h3>

<p>
This data frame has 236 rows and the following 9 columns:
<dl>
<dt><code>y</code></dt><dd>The count for the 2-week period.
</dd>
<dt><code>trt</code></dt><dd>The treatment, <code>"placebo"</code> or <code>"progabide"</code>.
</dd>
<dt><code>base</code></dt><dd>The counts in the baseline 8-week period.
</dd>
<dt><code>age</code></dt><dd>The subject's age, in years.
</dd>
<dt><code>V4</code></dt><dd><code>0/1</code> indicator variable of period 4.
</dd>
<dt><code>subject</code></dt><dd>The subject number, 1 to 59.
</dd>
<dt><code>period</code></dt><dd>The period, 1 to 4.
</dd>
<dt><code>lbase</code></dt><dd>The log-counts for the baseline period, centred to have zero mean.
</dd>
<dt><code>lage</code></dt><dd>The log-ages, centred to have zero mean.
</dd></dl>

<h3>Source</h3>

<p>
Thall, P. F. and Vail, S. C. (1990)
Some covariance models for longitudinal count data with over-dispersion.
<EM>Biometrics</EM>
<B>46</B>, 657&ndash;671.
</p>


<h3>References</h3>

<p>
Venables, W. N. and Ripley, B. D. (2002)
<EM>Modern Applied Statistics with S.</EM> Fourth Edition. Springer.
</p>


<h3>Examples</h3>

<pre>
summary(glm(y ~ lbase*trt + lage + V4, family = poisson,
            data = epil), cor = FALSE)
epil2 &lt;- epil[epil$period == 1, ]
epil2["period"] &lt;- rep(0, 59); epil2["y"] &lt;- epil2["base"]
epil["time"] &lt;- 1; epil2["time"] &lt;- 4
epil2 &lt;- rbind(epil, epil2)
epil2$pred &lt;- unclass(epil2$trt) * (epil2$period &gt; 0)
epil2$subject &lt;- factor(epil2$subject)
epil3 &lt;- aggregate(epil2, list(epil2$subject, epil2$period &gt; 0),
   function(x) if(is.numeric(x)) sum(x) else x[1])
epil3$pred &lt;- factor(epil3$pred,
   labels = c("base", "placebo", "drug"))

contrasts(epil3$pred) &lt;- structure(contr.sdif(3),
    dimnames = list(NULL, c("placebo-base", "drug-placebo")))
summary(glm(y ~ pred + factor(subject) + offset(log(time)),
            family = poisson, data = epil3), cor = FALSE)

summary(glmmPQL(y ~ lbase*trt + lage + V4,
                random = ~ 1 | subject,
                family = poisson, data = epil))
summary(glmmPQL(y ~ pred, random = ~1 | subject,
                family = poisson, data = epil3))
</pre>



<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?