c# pdf viewer wpf : How to reorder pdf pages in reader Library SDK class asp.net wpf winforms ajax v55i080-part464

texreg: Conversion of Statistical Model Output in R
to L
A
T
E
Xand HTML Tables
Philip Leifeld
Eawag&University ofBern
Abstract
A recurrent task in applied statistics is the (mostly manual) preparation of model
output for inclusioninL
A
T
E
X,Microsoft Word,orHTMLdocuments{usually withmore
thanone model presented in a single table along with several goodness-of-t statistics.
However, statistical models in R have diverse object structures and summary methods,
whichmakesthisprocess cumbersome. Thisarticle rst developsa set of guidelinesfor
converting statistical model output to LAT
E
X and HTML tables, then assesses to what
extentexistingpackagesmeettheserequirements,andnallypresentsthe texregpackage
asasolutionthatmeetsallofthecriteriasetoutinthebeginning. Afterprovidingvarious
usage examples,ablueprint for writing custommodelextensionsisproposed.
Keywords:reporting,table,coecients, regression, R, L
A
T
E
X,Microsoft Word, HTML,Mark-
down.
ThisR packagevignetteis based on an articlein theJournal ofStatistical Software(Leifeld
2013).
1. Typesetting R model output in L
A
T
E
Xand HTML
Theprimary purpose of the statistical programming language R (RCoreTeam2013) is the
analysisofdatawithstatisticalmodels. Oneofthestrengthsof Risthatuserscanimplement
their own statistical models. While this  exibility leads toan increased availability of even
exoticmodelsand shortercycles between model development and implementation, thereare
alsodownsidesofthis exibility. In particular,thereisnounieddatastructureofstatistical
models and no unied way of representing model output, which makes it hard to re-use
coecientsandgoodness-of-t(GOF)statistics inothersoftwarepackages,especiallyforthe
purpose ofpublishingresults.
Several generic functions weredeveloped to provide unied accessor methodsfor coecients
(thecoef()function),GOFstatistics(forexample,AIC(),BIC(),logLik(),ordeviance()),
acustom text representation of the tted model (summary()), and other relevant pieces of
information (e.g., nobs() and formula()). Details areprovided in Chapter 11 ofVenables,
Smith, and R Core Team(2013). Nonetheless, , manypopularpackageshave only y partially
implementedmethodsforthesegenerics,and insomecasestheydonotevenprovideaccessor
functions at all for their coecients or GOF statistics. Even worse, the model summary
methods are usually structured in idiosyncratic ways and do not lend themselves to easy
parsingofcoecients and GOFstatistics.
How to reorder pdf pages in reader - re-order PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Support Customizing Page Order of PDF Document in C# Project
move pdf pages online; pdf rearrange pages
How to reorder pdf pages in reader - VB.NET PDF Page Move Library: re-order PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sort PDF Document Pages Using VB.NET Demo Code
pdf reverse page order online; rearrange pdf pages reader
2
texreg: ConversionofRModel OutputtoL
A
T
E
Xand HTML
Modernscienticjournals,ontheotherhand,oftenrequirenicelyformattedandstandardized
modeloutput,usuallyintheformofcoecienttablesforoneormoremodels. Inthemajority
of applications, these tables show more than one model aligned next to each other with
partiallyoverlappingcoecientnames,standarderrorsinparentheses,andsuperscriptedstars
indicating the signicance of model terms. At the bottom of the table, summary statistics
like thenumber ofobservations are reported, and GOFmeasures like AIC or R
2
are shown.
Due to the idiosyncratic way model output is currently represented in various classes in R,
designingthesekinds of tables fora papersubmission requires asubstantial amount oftime
andpatience,especiallyifmorethanonemodelisinvolvedandiftherearemanymodelterms.
Copyingand pastingcoecientsandstandarderrorsoneatatimeoften becomesthedefault
wayofhandlingthis task.
AnimportanttoolfortypesettingacademicpapersinmanyacademiceldsisL
A
T
E
X(Lamport
1986).Infact,RandL
A
T
E
XarecloselylinkedbytheSweave()command intheutilspackage
(RCoreTeam2013), which allows the integration of R commands in L
A
T
E
Xdocuments and
theirexecutionandevaluationatruntime(Leisch2002). Inspiteofthis,common approaches
for linking R model output and tables in L
A
T
E
Xinclude (1) copying and pasting individual
values after every change of the model, (2) custom user-written functions which convert a
specic model into a matrix, (3) the use of sophisticated table-management packages (see
next section), and (4) the inclusion of single models in the form of the model summary
instead of nicelyaligned coecient tables as asecond best solution.
PopularalternativesfordocumentpreparationincludeMicrosoftWordandthedynamicreport
generation R package knitr (Xie2013a,b,c). Both knitr and Microsoft Word accept HTML
input, and knitr additionallysupportsMarkdown,asimpliedHTML-likemarkup language.
Theseplatformsfacesimilarcomplicationsas L
A
T
E
XandSweave()regardingthepreparation
of regression tables for multiple statistical models.
TheidealwaytoprepareRmodeloutputforLAT
E
XandHTMLtableswouldbeagenericfunc-
tion which would directly output LAT
E
Xor HTML tables and for which custom methods for
anymodeltypecouldbewrittenasextensions. Whileseveralattemptsalreadyexist(seeSec-
tion3),allofthemhavelimitations. Thisarticleintroducesthetexregpackage(Leifeld2014),
whichcloses thisgapand provides aunied framework for typesettingLAT
E
Xand HTML ta-
bles for various statistical models in R. Package texregis availablefrom the Comprehensive
RArchive Network (CRAN) athttp://CRAN.R-project.org/package=texreg.
Theremainderofthisarticleis structured asfollows: Section2setsoutanumberofrequire-
ments which must bemet. In thelight ofthese requirements, Section3 compares texreg to
other Rpackagesand functionswhich weredesigned forsimilarpurposes. Section4describes
the way how texreg works and how its functions and classes are related. After providing
several examplesand illustratingtheoptions ofthetexreg(), htmlreg(), and screenreg()
functions (Section5), Section6describes how new extensions can beimplemented.
2. Requirements
Thedesignofthetexregpackagetriestoaccomplishsixgoals: itshouldbecapableofdealing
with several models in a single table; it should be easily extensible by package writers and
users; it should provide options for using the available space in an optimal way; it should
take advantage of advanced layout capabilities in L
A
T
E
Xand HTML; it should take care of
C# TIFF: How to Reorder, Rearrange & Sort TIFF Pages Using C# Code
Reorder, Rearrange and Sort TIFF Document Pages in C#.NET Application. C# TIFF Page Sorting Overview. Reorder TIFF Pages in C#.NET Application.
reorder pdf pages online; reorder pages in pdf reader
C# PDF: C# Code to Process PDF Document Page Using C#.NET PDF
just following attached links. C# PDF: Add, Delete, Reorder PDF Pages Using C#.NET, C# PDF: Merge or Split PDF Files Using C#.NET.
reorder pdf page; how to move pages in pdf reader
Philip Leifeld
3
journal- or model-specic habits or best practices; and it should nd an optimal balance of
customizabilityand usability. Theserequirementsareelaboratedinthefollowingparagraphs.
2.1. Managing multiple models
Quite often, almost-identical models are printed in order to show how an additional model
term alters the other coecients and standard errors. Thereare, however, alsocases where
dierent model types are applied to the same data. This implies that the package must
not only beabletomergethenames of coecients to guarantee comparability of coecient
columns;it mustalsobeabletodeal with dierentmodel classes and accommodatedierent
kindsofGOFstatistics inthesametable.
Moreover, it must be possibletorenamethemodel terms and GOF statistics. Custom coef-
cientnamesnotonlymakethe outputmoreeasilycomprehensibebythereaders; renaming
model termsisalsomandatory forunifyingterms between several models. Forexample, two
modelsbasedupontwodierentdatasetsmayhavedierentvariablenamesforthesamekind
of theoretical construct. This would result in two separate but complementary rows in the
coecient table. It should be possible to rename coecients and then con ate any two or
morecomplementaryrows with identical labels.
Finally, it should be possible to assign custom names for the dierent models, instead of
the default\Model 1",\Model 2", etc. While it may be easy to rename them manually in
manyapplications, particularlySweave()and knitr() requirethatnomanual manipulation
is necessary.
2.2. Using generics to make texreg easily extensible
Dierent model classes have dierent ways how their coecients and GOFstatistics can be
accessed. Hardcoding these extraction rules intothe functions of the texreg package would
inhibitcustomizability. Thebestwaytomaketexregextensibleistohaveagenericextract()
function which can be invoked on any kind of model, just like plot() or print() generics
in R. Anyuser|especiallymodelclassauthors|would then beable toadd custom methods
totheextract() function in order to make texreglearn howtocope with new models. For
example, an extract() method for ‘lm’ objects can be written to deal with linear models,
or an extract() method for ‘ergm’ objects can be written to make the generic extract()
function understand exponential random graph models. All the user has to do is write a
custom extract function for a specic model type and then register it as a method for the
genericextract() function. Section6providesdetails on howthiscan be accomplished.
2.3. Use available space eciently
If a table has many model terms and if standard errors are printed in parentheses below
thecoecients, thetable may becometoo large for a singlepage. For this reason, it should
be possible to print standard errors right beside the coecients instead of aligning them
vertically. In texreg, this isachieved with the single.row argument.
If tables growtoo large, othermeasures mightprove useful: removingtable margins, setting
thetablein scriptsize, or settingcustom  oatpositions(for LAT
E
Xtables). Very wide tables
should berotated by90degrees usingthesidewaystableenvironmentin theL
A
T
E
Xpackage
rotating (RahtzandFairbairns2008) in order to use the available space in an optimal way.
VB.NET PowerPoint: Sort and Reorder PowerPoint Slides by Using VB.
Sort and Reorder PowerPoint Slides Range with VB amount of robust PPT slides/pages editing methods powerful & profession imaging controls, PDF document, image
change page order pdf; how to rearrange pages in pdf using reader
VB.NET PDF: Create PDF Document Viewer in C#.NET for Document
Support navigating to the previous or next page of the PDF document; Able to insert, delete or reorder PDF document page in VB.NET document viewer;
how to rearrange pdf pages; reorder pages in pdf
4
texreg: ConversionofRModel OutputtoL
A
T
E
Xand HTML
The user should also be able to set the table caption and label, decide whether the table
should be in a oat environment(forL
A
T
E
Xtables), alignthetable horizontallyon the page,
and settheposition ofthecaption. The texregpackage provides arguments tocontrol all of
theseaspects.
2.4. Beautiful and clean table layout
For LAT
E
Xtables, the LAT
E
Xpackage dcolumn (Carlisle2001) provides facilities for aligning
numbersin tablecells nicely, forexampleattheirdecimal separators. Thebooktabs package
(Fear2005)candrawtop,midandbottomrulesfortablesandproducesacleanerlayoutthan
thedefaulthorizontal lines. Both packagesare supported by texreg and can be switched on
or odependingon theavailabilityofthepackages in the LAT
E
Xdistribution.
ForHTML tables, cascadingstylesheets (CSS) should beusedtoadjustthelayout, and the
user should be able to decidewhether CSS markup should be included in the le header or
inline.
2.5. Journal- or model-specic requirements
Academic journals may have dierent requirements regarding the number of digits to be
printed,theinclusion ofsuperscripted stars indicatingsignicance, or the removal ofleading
zeroes. Similarly, there are best practices in dierent academic communities or for specic
model types. For example, it is common practice to attach three stars to coecients with
pvalues 0:001 and small centered dots to coecients with p values between 0:05 and 0:1
in exponential random graph models, while less ne-grained signicance levels are adopted
in many other communities (for example, three stars for p 0:01, or only one star or bold
formatting for one single signicance level). In yet other communities, journals or models,
pvalues or signicance stars are not required or even deemed inappropriate (see the lme4
packagebyBates,Maechler,Bolker,andWalker2013).
2.6. Customizability and usability
Dierent users have dierent applications in mind. For this reason, a solution should beas
exibleaspossibleandoercustomizationviaarguments. Forexample,inclusionofanHTML
tableinaknitrMarkdowndocumentrequiresthatonlythetableisprintedwithoutanyheader
or document typeinformation, and that signicancestarsare escaped usingbackslashes.
In other situations, itmaybeimportantto(1) omitcertaincoecients (likerandom orxed
eectsorthresholds),(2)reorderthecoecientsin themodel (e.g.,becausesomemodelsput
interactioneectsattheend ofthelistofcoecients),or(3)replacecoecients, standarder-
rors, orpvaluesbycustom vectors,forexamplewhenheteroskedasticity-consistent(\robust")
standard errors areused (Zeileis2004).
C# PDF Page Rotate Library: rotate PDF page permanently in C#.net
Enable batch changing PDF page orientation without other PDF reader control. PDF page, delete certain PDF page, reorder existing PDF pages and split
how to reorder pdf pages in; reordering pages in pdf
VB.NET TIFF: Modify TIFF File by Adding, Deleting & Sort TIFF
Users can use it to reorder TIFF pages in ''' &ltsummary> ''' Sort TIFF document pages in designed powerful & profession imaging controls, PDF document, image
reverse page order pdf online; how to move pages in pdf converter professional
Philip Leifeld
5
Argument
texreg
htmlreg
screenreg
Short description
l
 Model or list ofmodels
file
 Divertoutput toale
single.row
 Printcoefs and standarderrors in the samerow?
stars
 Threshold levels forsignicance stars
custom.model.names 
 Setthenames ofthemodels
custom.coef.names
 Replace the namesof the model terms
custom.gof.names
 Replace the namesof the GOF statistics
custom.note
 Replace the defaultsignicancelegend
digits
 Numberofdecimal places
leading.zero
 Printleadingzeroes?
symbol
 Dotsymbol denoting afourth signicancelevel
override.coef
 Replace coecientsbycustom vectors
override.se
 Replace standard errors by custom vectors
override.pval
 Replace pvalues bycustom vectors
override.ci.low
 Replace lower condence intervals
override.ci.up
 Replace uppercondenceintervals
omit.coef
 Removerows usingaregularexpression
reorder.coef
 Provideacustom orderforthemodelterms
reorder.gof
 Provideacustom orderfortheGOFstatistics
ci.force
 Convert standard errors tocondence intervals
ci.level
 Condence level for CIconversion
ci.star
 Printstarwhen 0is not contained in theCI
groups
 Partition rows ofthetable intogroupswith labels
custom.columns
 Add custom text columnstothetable
custom.col.pos
 Denewherecustom columns should be placed
bold
 p valuebelowwhich coecientsarebolded
center
 Horizontalalignment on thepage
caption
 Setthecaption ofthetable
caption.above
 Should the caption beplaced abovethetable?
label
 Setthelabelofthetable
booktabs
 Usethebooktabs package(Fear2005)?
dcolumn
 Usethedcolumn package(Carlisle2001)?
sideways
 Usesidewaystable(RahtzandFairbairns2008)
use.packages
 Printthe\usepackage{}declarations?
table
 Wrap tabularin atableenvironment?
no.margin
 Removemargins between columns tosave space
scriptsize
 Usesmallerfontsize tosave space
float.pos
 Specify  oatingpositionofthetable
star.symbol
 Changethesignicance symbol
inline.css
 UseCSS in the text rather than theheader
Continued on nextpage
VB.NET PDF: VB.NET Guide to Process PDF Document in .NET Project
It can be used to add or delete PDF document page(s), sort the order of PDF pages, add image to PDF document page and extract page(s) from PDF document in VB
how to rearrange pages in pdf document; how to rearrange pages in a pdf document
VB.NET TIFF: VB.NET Sample Code to Process & Manage TIFF Page
certain TIFF page, and sort & reorder TIFF pages in Process TIFF Pages Independently in VB.NET Code. powerful & profession imaging controls, PDF document, image
pdf change page order online; move pages in pdf online
6
texreg: ConversionofRModel OutputtoL
A
T
E
Xand HTML
Table 1{continued from previouspage
Argument
texreg
htmlreg
screenreg
Short description
doctype
 Include the DOCTYPE declaration?
html.tag
 Include the <html>tag?
head.tag
 Include the <head>tag?
body.tag
 Include the <body>tag?
indentation
 Indentation ofsubelements in the HTML code
column.spacing
 Numberofspaces between columns
outer.rule
 Linetypefor the outer rule
inner.rule
 Linetypefor the inner rule
...
 Additional argumentsfortheextractfunctions
Table 1: Arguments ofthetexreg(), htmlreg() and screenreg() functions.
On theotherhand,usersshouldnotberequired tolearn themeaningofall argumentsbefore
theycantypesettheirrsttable. Thedefaultargumentsshouldservetheneedsofoccasional
users. Moreover, adjusting tables based on acomplexset of arguments should befacilitated
byprintingtables totheRconsolebeforeactuallygeneratingtheLAT
E
Xor HTML output. If
thisscreenrepresentation ofthetableisnicely formatted and alignedusingspacesandrules,
it can also serve as an occasional replacement for the generic summary() method for easy
model comparison as partofthe statistical modeling work ow.
Thetexregpackagetriestobalancetheseneedsforcustomizabilityandusabilitybyproviding
manyarguments forlayoutcustomization(seeTable1foralistofarguments),usingsensible
default values for occasional users, and providing a function for on-screen display of tables
foreasymodel comparison and layoutadjustment.
3. Comparison with other packages
Besidetexreg, several other packages were designed toconvert R model output toLAT
E
Xor
HTML tables.
Thextable package(Dahl2012) is able to typeset various matrices and data frames from R
as LAT
E
XorHTML tables. Itisvery exibleand has its strengthsparticularly whenitcomes
totablesofsummarystatistics. However,itwasnotspecicallydesignedforstatisticalmodel
output. Similarly, the mat2tex() command from the sfsmisc package (Maechlerandothers
2012)canexportmatricestoL
A
T
E
X, and the tex.table() function in the cwhmisc package
(Homann2012)is abletoexportdataframes as L
A
T
E
Xtables.
For several years, the outreg() function in the rockchalk package (Johnson2012) has been
available forexportingmultiple regression models to LAT
E
X. However, thefunction remains
fairly basic and does notprovidea great deal of layout options, generics, and custom model
types(in fact, only‘lm’ and ‘glm’ objects).
Philip Leifeld
7
Theapsrtable package(Malecki2012), the mtable()function from thememiscpackage(El
2012),andthestargazerpackage(Hlavac2013)aremoreadvancedandcanalsomergemultiple
modelsin asingletable. apsrtable andmemiscfeaturecustomfunctionsfortheextractionof
coecientandGOFinformation,andtheyarebasedongenerics. Inthisregard,bothpackages
aresomewhatsimilartothetexregpackage. texreg,however,oersmorestraightforwardways
of custom model implementation. Thisimportant feature isnotablyabsent from stargazer.
Class
Package
Description
‘aftreg’
eha
Accelerated failure time regression
‘Arima’
stats
ARIMA timeseriesmodels
‘ARIMA’
forecast
ARIMA timeseriesmodels
‘averaging’
MuMIn
Model averaging objects
‘bam’
mgcv
Generalized additivemodels
‘betareg’
betareg
Betaregression forrates and proportions
‘brglm’
brglm
Bias-reducedgeneralizedlinear models
‘btergm’
xergm
Temporal exponentialrandom graph models
‘censReg’
censReg
Censored regression(tobit)models
‘clm’
ordinal
Cumulativelink models
‘clogit’
survival
Conditional logisticregression
‘coeftest’
lmtest
Wald testsof estimated coecients
‘coxph’
survival
Coxproportional hazard models
‘coxph.penal’
survival
Coxproportional hazard with penaltysplines
‘dynlm’
dynlm
Timeseries regression
‘ergm’
ergm
Exponentialrandom graph models
‘ergmm’
latentnet
Latent space and latentclustermodels
‘ets’
forecast
Exponentialsmoothingstate spacemodels
‘felm’
lfe
Linear modelswith multiplegroup xed eects
‘fGARCH’
fGarch
GARCH timeseries models
‘forecast’
forecast
Timeseries forecasting
‘gam’
mgcv
Generalized additivemodels
‘gamlss’
gamlss
GAM for location scaleand shape
‘gee’
gee
Generalized estimatingequation
‘glm’
stats
Generalized linear models
‘[gl|l|nl]merMod’ lme4(<1.0)
Generalized linear mixed models
‘glmmadmb’
glmmADMB
Generalized linear mixed models and extensions
‘glmrob
robustbase
Robustttingof generalized linear models
‘gls’
nlme
Generalized leastsquares
‘gmm’
gmm
Generalized method of moments estimation
‘ivreg’
AER
Instrumental-variableregression using2SLS
‘hurdle’
pscl
Hurdleregression modelsforcountdata
‘lm’
stats
Ordinary least squares
‘lme’
nlme
Linear mixed-eects models
‘lme4’
lme4(1.0)
Linear mixed-eects models
‘lmrob’
robustbase
MM-typeestimators for linearmodels
Continued on next page
8
texreg: ConversionofRModel OutputtoL
A
T
E
Xand HTML
Table2{continued from previous page
Class
Package
Description
‘lnam’
sna
Linear network autocorrelation models
‘lqmm’
lqmm
Linear quantilemixed models
‘lrm’
rms, Design
Logistic regression models
‘maBina’
erer
Marginal eects forbinary responsemodels
‘mlogit’
mlogit
Multinomial logit models
‘mnlogit’
mnlogit
Multinomial choicemodels
‘multinom’
nnet
Multinomial log-linear models
‘model.selection’ MuMIn
Model selectionobjects
‘mtergm’
btergm
MCMC-based TERGM
‘negbin’
MASS
Negativebinomial generalized linearmodels
‘netlogit’
sna
Logistic regression for networks
‘nlme’
nlme
Nonlinear mixed-eects models
‘ols’
rms
Ordinary least squareslinearmodels
‘pgmm’
plm
GMMestimation forpanel data
‘phreg’
eha
Parametricproportional hazards regression
‘plm’
plm
Linear modelsfor paneldata
‘pmg’
plm
Linear panel modelswith heterogeneous coecients
‘polr’
MASS
Ordered logisticor probitregression
‘Relogit’
Zelig
Rareeventslogisticregression
‘rem.dyad’
relevent
Relational eventmodels fordyadicdata
‘rlm’
MASS
Robustttingof linear models
‘rq’
quantreg
Quantileregression models
‘sclm’
ordinal
Cumulativelink models
‘selection’
sampleSelection Sampleselection models
‘sienaFit’
RSiena
Stochastic actor-oriented models for networks
‘simex’
simex
SIMEXalgorithm for measurementerror models
‘stergm’
tergm
Temporal exponentialrandom graph models
‘survreg’
survival
Parametricsurvival regression models
‘survreg.penal’
survival
Frailtysurvival models
‘svyglm’
survey
Survey-weighted generalized linearmodels
‘systemfit’
systemt
Linear structural equations
‘texreg’
texreg
Foreasymanipulation of texregtables
‘tobit’
AER
Tobitregressionmodelsfor censored data
‘weibreg’
eha
Weibullregression
‘zelig’
Zelig
Zeligmodels (Owen,Imai,King,andLau2013)
‘zeroinfl’
pscl
Zero-in ated regression models
Table 2: List of71supported model types(version1.36).
The apsrtable package (version 0.8-8) has custom functions for ‘coxph’, ‘gee’, ‘glm’, ‘lm’,
‘lrm’, ‘negbxin,’ ‘svyglm’ and ‘tobit’ objects,butitdoesnotfeature anymultilevel models
ornetworkmodels. Thememiscpackage(version0.95-38)features‘aftreg’,‘betareg’,‘clm’,
‘dynlm’, ‘glm’, ‘hurdle’, ‘ivreg’, ‘lm’, ‘lmer’, ‘mer’, ‘multinom’, ‘phreg’, ‘polr’, ‘tobit’,
Philip Leifeld
9
‘simex’, ‘survreg’,‘weibreg’,and ‘zeroinfl’modelsbutcannothandleanynetworkmodels
and recentversionsoflme4multilevel models (Batesetal.2013).
The stargazer package (version 3.0.1) has built-in functions for ‘betareg’, ‘clm’, ‘clogit’,
‘coxph’,‘ergm’,‘gam’,‘gee’,‘glm’,‘glmerMod,‘gls’,‘hurdle’,‘ivreg’,‘lm’,‘lmerMod,‘lmrob’,
‘multinom’,‘nlmerMod’,‘plm,‘pmg’,‘polr’,‘rlm’,‘survreg’,‘svyglm,‘tobit’,and‘zeroinfl’
objectsaswellasseveralZeligadaptations(Owenetal.2013),butitdoesnotsupportcustom
user extensions.
texreg (version 1.36), in contrast, can deal with all of the above model types (that is, the
unionofallthreepackages,isextensible,andoersadditionalbuilt-infunctionsforthefollow-
ing model classes: ‘ARIMA’, ‘averaging’, ‘bam’, ‘brglm’, ‘btergm’, ‘censReg’, ‘coxph.penal’,
‘ergmm’, ‘ets’, ‘fGARCH’, ‘forecast’, ‘gamlss’, ‘glmmadmb’, ‘glmrob’, ‘felm’, ‘gmm’, ‘lme’,
‘lme4’,‘lnam’,‘lqmm’,‘maBina’,‘mlogit’,‘mnlogit’,‘mtergm’,‘model.selection’,‘netlogit’,
‘nlme’, ‘rem.dyad’, ‘rq’, ‘sclm’, ‘selection’, ‘stergm’, ‘systemfit’, and ‘texreg’ objects.
Table2gives an overview ofcurrentlyimplemented model types.
texreg supports Microsoft Word, HTML, Markdown, and knitr whereas the other packages
(except for xtable) are restricted to LAT
E
Xoutput. apsrtable has an option for Sweave in-
tegration, which does not require any argument in texreg. In the memisc package and in
texreg, the booktabs and dcolumn LAT
E
Xpackages for table layout (seeSection2.4) can be
used, which isnotavailablein apsrtable(and onlydcolumn is supported in stargazer).
While apsrtable and texreg allow for custom GOF measures, memisc and stargazer only
featureasetofhardcoded statistics. Apart from this, allpackagespresented herearesigni-
cantlyless exiblethantexregregardingtheutilization ofspace(Section2.3), layout options
(Section2.4), outlet- ormodel-specicrequirements (Section2.5), and customizability (Sec-
tion2.6).
4. Under the hood: How texreg works
Thetexregpackageconsists ofthreemain functions:
1. texreg()forLAT
E
Xoutput;
2. htmlreg() for HTML, Markdown-compatibleand MicrosoftWord-compatibleoutput;
3. screenreg()fortextoutputtothe Rconsole.
Therearevariousinternalhelperfunctions,whicharecalledfromeachofthesemainfunctions
forpurposesofpre- and postprocessing. Moreover, thereisaclass denition for‘texreg’ ob-
jects,and agenericextract()functionalongwithitsmethodsforvariousstatistical models.
Figure1illustratestheprocedurefollowingacall ofoneofthemain functions. Details about
each stepare provided below.
4.1. The generic extract() function and its methods
First,the userhands over amodel objectoralist ofmodelstothe texreg(), htmlreg() or
screenreg() function. This main function calls thegeneric extract() function in order to
retrievealltherelevantpiecesofinformationfromthemodels. Theextract()functionknows
10
texreg: Conversion ofR Model Output toL
A
T
E
Xand HTML
extract
‘texreg’
objects
preprocess
‘texreg’
objects
mergemodels
andaggregate
matrices
post-
process
matrices
aggregate
and con-
atetable
typeset
nal
table
Figure 1: Simplied  owdiagram ofa texreg(), htmlreg(), or screenreg()call.
how to cope with various model types (see Table2) because it merely calls the appropriate
extract() method designed for the specic model type. For example, if the model is of
class ‘lm’, extract() calls the extract() method for ‘lm’ objects, etc. Custom extract()
methods can beeasily added (see Section6).
Anextract()methodaggregatesvariousrequired piecesofinformation,likethecoecients,
theirnames, standard errors,pvalues,andseveral GOFmeasures. Whichmeasuresareused
dependson thespecic extract() method. It is alsopossible toletthe user decide: beside
themodelargument, each extractmethod is allowed tohave morearguments. For example,
the extract() method for ‘lme4’ objects, which are lme4 multilevel models (Bates et al.
2013),hasBooleanoptionslikeinclude.variance,whichturnsontheinclusionofrandom
eect variances in the GOF block, and numeric arguments like conf.level, which sets the
condence level for computation of prole or bootstrapped condence intervals. When the
main function is called in the rst place, the user can include these custom arguments to
netune the behavior ofthe extract()methods.
Once the relevant data have been extracted from a model object, the extract() method
creates a ‘texreg’ object by callingthe createTexreg() function and handing over the ex-
tracted data. The ‘texreg’ object or the list of ‘texreg’ objects is nally returned to the
main function.
4.2. ‘texreg’ objects: An S4 class
Thereis an S4 class denition for ‘texreg’ objects. Such an objectcontainsfour vectorsfor
the coecients|the coecient values (numeric), their names (character), standard errors
(numeric), and p values (numeric)|, and three vectors for the GOF statistics: the GOF
values(numeric),theirnames(character),anddummyvariablesindicatingwhetheritmakes
sense for the GOF value to have several decimal places (logical); for example, one would
not wantthenumberof observations tohaveanydecimal places.
As some types of statistical models report condence intervals rather than standard errors
and p values, the ‘texreg’ class denition can alternatively store lower and upper bounds
of condence intervals instead of standard errors and p values. Which slots of the class are
used depends on the extract() method for the specic model. The texreg package checks
whether standard errors arepresent in the‘texreg’ object and useeither standard errors or
condenceintervalsdependingon availability.
Theclass containsvalidation rules which makesurethat the fourcoecient vectors all have
the same length and that the three GOF vectors also all have the same length. There are
several exceptions to this rule: the p values, the condence intervals, and the decimal-place
vector areoptional and mayalsohave alength of zero.
The‘texreg’classdenitionwaswrittentofacilitatethehandlingoftherelevantpiecesofin-
formation. Handingoverlistsof‘texreg’objectsbetweenfunctionsismoreuser-friendlythan
Documents you may be interested
Documents you may be interested