[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
groff bug?
From: |
John Koval |
Subject: |
groff bug? |
Date: |
Thu, 10 Apr 2003 12:30:54 -0400 (EDT) |
I apologize for flooding the "complaints" department, but
about Nov 17 I sent out an initial description of my problem,
and I received a reply from one or you in February,
but I LOST your reply so I don't know who to send this further information to.
Hence I am sending it to EVERYONE!!.
Running groff 1.17.2 compiled unded gcc 2.95.2 on Sun SPARCS and Ultras,
running SunOS 5.8 (also known as Solaris 2.8 or Solaris 8???)
Small files run fine, but the attached file, when run with command
groff -et -ms filename
produces the following error messages
testg:67: warning: can't find font `['
testg:67: missing closing delimiter
testg:67: missing closing delimiter
testg:74: missing closing delimiter
testg:74: missing closing delimiter
testg:85: missing closing delimiter
testg:85: missing closing delimiter
testg:95: missing closing delimiter
testg:95: missing closing delimiter
testg:104: missing closing delimiter
testg:104: missing closing delimiter
testg:112: missing closing delimiter
testg:112: missing closing delimiter
also when previewed with gxditview,
has
2.TS before each table
and
2.PP after first table
as weil as having problems with all major equations
We tried to compile groff 1.18.?? but had some problems,
presumably because we were not using gcc 3.???,
but when we tried to compile gcc 3.???, we also had some problems.
I am really looking forward to using groff, because
1. I have been personally maintaining ditroff and xtroff
2. I have several sets of courses notes (total of over 1000 pages)
written in troff
3. I would like to be able to work on my pc at home, as well as on the
Sun machine at work
Thanks for your help in this.
John Koval Department of Epidemiology and Biostatistics
University of Western Ontario London Ontario Canada N6A 5C1
(519)661-2111 Ext. 86271 address@hidden
FAX: (519)661-3766
.EQ
delim $$
gsize 12
.EN
.DA
.nr PS 12
.nr VS 14
.nr H1 14
.OH 'Biostats 2'topics in linear regression'14.%'
.EH '14.%'topics in linear regression'Biostats 2'
.DS C
.B
Chapter 14
Topics in linear regression
.DE
.PP
In this chapter we consider topics using simple linear regression:
.IP 1
regression of proportions;
.IP 2
diagnostics to see if the data
actually follows the linear regression model we have fitted.
.NH 2
Regression with proportions
.PP
Occasionally, the rows(or columns) in a contingency table
are taken over the values of a continuous variable, but, for the
sake of a simple analysis, they have been forced into categories.
If the overall analysis of the $2 times c$ (or the $r times 2$) table
shows a significant effect, it may be of interest to see if the relationship
is linear in the original continuous variable.
.PP
There are currently some very sophisticated methods of analysing this type
of data, for example, log-linear and logistic analyses, but these are
covered later.
.PP
Consider a data set on the occurrence of insomnia of women of varying
ages. The age information has initially collapsed into six age
categories to produce a $6 times 2$ contingency table:
.TS
center allbox tab(`);
c s s s s
c c s c c
l n n n n.
Table 14.1.1: Contingency table for age-insomnia data
`Insomnia
age`yes($f sub i$)`no`total($n sub i$)`proportion($p sub i$)
18-24`150`384`534`0.2809
25-34`250`496`746`0.3351
35-44`264`520`784`0.3367
45-54`302`403`705`0.4284
55-64`238`205`443`0.5372
65-74`176`123`299`0.5886
Total`1380`2131`3511`0.39305
.TE
.PP
To test for the presence of an association between insomnia and age, we
could perform a chi-square test for association by calculating
.EQ (14.1.1)
sum from i=1 to 6 sum from j=1 to 2 {(e sub ij - o sub ij ) sup 2}over{e sub ij}
.EN
where $o sub ij$ is the observed frequency in cell $(i,j)$ and $e sub ij$ is
the expected frequency in that cell under the null hypothesis of no association.
Under the null hypothesis of no association, $S$ has a chi-square distribution
on $(r-1)$ degrees of freedom, that is
.EQ
S \(ap chi sub r-1 sup 2
.EN
.PP
.ne 8
For a $r times 2$ table with the rows representing Yes/No
(Presence/Absence), the usual chi-square for association (14.1.1) may be
rewritten
as
.\"sum from i=1 to r [n sub i (p sub i - p bar ) sup 2 ]/[ p bar (1- p bar )]
.\"=( sum n sub i p sub i sup 2 - n p bar sup 2 )/[ p bar (1- p bar )]
.EQ (14.1.2)
n{n sum to r (f sub i sup 2 /n sub i )- f sup 2 }
over{f(n-f)}
.EN
where $n sub i$ is the row total, that is, the total number in each
age group, $n= sum n sub i$ is the total number of subjects, $f sub i$ is
the frequency of the condition in row $i$, and
$f = sum f sub i$
is the overall frequency of the condition. For the age-insomnia data,
we have
.EQ
S = 3511{3511(150 sup 2 /534 + 250 sup 2 /746 + ... + 176 sup 2 /299)
-1380 sup 2 }over{1380(2131)}=139.3092,
.EN
which as a $chi sub 5 sup 2$ is highly significant (p<0.001).
.PP
Because of the large numbers which appear in both numerator and denominator
of (14.1.2), an alternative formula for the calculation of the chi-square
test for association is
.EQ (14.1.3)
{ sum to r (f sub i sup 2 /n sub i )- f sup 2 /n}over
{ p bar (1- p bar )}
.EN
where $p bar$ is the overall proportion of subjects having the condition,
that is,
$p bar = f/n$.
This formula leads to the calculation
.EQ
S = {(150 sup 2 /534 + 250 sup 2 /746 + ... + 176 sup 2 /299)
-1380 sup 2 /3511}over{0.39305(0.60695)}=139.3092.
.EN
.PP
Having decided that we have a significant relationship between age and
occurrence
of insomnia, we examine table 14.1.1 and notice that
the proportions increase somewhat regularly with age.
It is of interest whether this increase is linear. To investigate this
hypothesis, we fit a linear regression of the proportion to the mid-point
of the age in each category, assuming that, in category $i$, we have $n sub i$
observations of $p sub i$ at the mid-point of the age category,
where $p sub i$ is the proportion of subjects having the condition,
that is,
$p sub i = f sub i /n sub i$.
There are two methods of performing the calculations for estimation
and testing:
.IP 1.
using a simple modification of the regression calculations used
earlier in this chapter,
.IP 2.
using a more complex modification of the regression calculations,
which provide the same answers with fewer steps.
.bp
.SH
Method 1:
.PP
As done in a previous chapter, we rewrite table 14.1.1 in the following way:
.ps -2
.vs -2
.EQ
gsize 10
.EN
.TS
center allbox tab(`);
c s s s s s s
c c c c c c c
c c c c c c c
n n n n n n n.
Table 14.1.2: Table for first method of performing regression with proportions
age midpoint`proportion`group size
$x sub i$`$p sub i$`$n sub i$`$n sub i x sub i$`$n sub i x sub i sup 2 $`$n sub
i p sub i$`$n sub i p sub i x sub i$
21.5`0.2809`534`11481`246841.5`150`3225
30`0.3351`746`22380`671400`250`7500
40`0.3367`784`31360`1254400`264`10560
50`0.4284`705`35250`1762500`302`15100
60`0.5372`443`26580`1594800`238`14280
70`0.5886`299`20930`1465100`176`12320
total``3511`147981`6995042`1380`62985
.TE
- groff bug?,
John Koval <=