Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch fix for long formula names #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions R/coxph.R
Expand Up @@ -33,7 +33,10 @@ coxph <- function(formula, data, weights, subset, na.action,
terms(formula[[1]], specials=ss, data=data)
else Terms <- if (missing(data)) terms(formula, specials=ss) else
terms(formula, specials=ss, data=data)

attr(Terms,'term.labels') = gsub('\n',' ', attr(Terms,'term.labels'))
colnames(attr(Terms,'factors')) = gsub('\n',' ', colnames(attr(Terms,'factors')))
rownames(attr(Terms,'factors')) = gsub('\n',' ', rownames(attr(Terms,'factors')))

tcl <- attr(Terms, 'specials')$cluster
if (length(tcl) > 1) stop("a formula cannot have multiple cluster terms")

Expand Down Expand Up @@ -127,7 +130,10 @@ coxph <- function(formula, data, weights, subset, na.action,
# okay, now evaluate the formula
mf <- eval(tform, parent.frame())
Terms <- terms(mf)

attr(Terms,'term.labels') = gsub('\n',' ', attr(Terms,'term.labels'))
colnames(attr(Terms,'factors')) = gsub('\n',' ', colnames(attr(Terms,'factors')))
rownames(attr(Terms,'factors')) = gsub('\n',' ', rownames(attr(Terms,'factors')))

# Grab the response variable, and deal with Surv2 objects
n <- nrow(mf)
Y <- model.response(mf)
Expand Down
Binary file added noweb/balance.pdf
Binary file not shown.
35 changes: 35 additions & 0 deletions noweb/code.aux
@@ -0,0 +1,35 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Cox Models}{2}{section.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Coxph}{2}{subsection.2.1}}
\citation{Gail81}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Exact partial likelihood}{28}{subsection.2.2}}
\newlabel{d0}{{1}{29}{Exact partial likelihood}{equation.2.1}{}}
\newlabel{d1}{{2}{29}{Exact partial likelihood}{equation.2.2}{}}
\newlabel{d2}{{3}{29}{Exact partial likelihood}{equation.2.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Andersen-Gill fits}{38}{subsection.2.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Predicted survival}{57}{subsection.2.4}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.4.1}Multi-state models}{80}{subsubsection.2.4.1}}
\@writefile{toc}{\contentsline {section}{\numberline {3}The Fine-Gray model}{87}{section.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}The predict method}{93}{subsection.3.1}}
\newlabel{eq:eta}{{7}{100}{The predict method}{equation.3.7}{}}
\@writefile{toc}{\contentsline {section}{\numberline {4}Concordance}{104}{section.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Main routine}{104}{subsection.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Methods}{112}{subsection.4.2}}