Learn R Programming

Hmisc

Harrell Miscellaneous

Current Goals

Web Sites

To Do

  • Consider using the haven package for importing SAS, Stata, and SPSS files; haven stores labels as the label attribute of each variable as does Hmisc; it converts date and time variables automatically and allows one to specify a format catalog along with the primary dataset
  • See if the readstata13 package has advantages over the foreign package for Stata file import
  • Consider creating xl.get using the readxl package to read .xls and .xlsx Excel files
  • In impute.transcan, sense if a variable in data is not a factor whereas it was treated as a factor during aregImpute; it should be converted to factor before the line v[sub] <- ... levels(as.integer...)) is run

Copy Link

Version

Install

install.packages('Hmisc')

Monthly Downloads

215,746

Version

5.1-3

License

GPL (>= 2)

Last Published

May 28th, 2024

Functions in Hmisc (5.1-3)

Hmisc-internal

Internal Hmisc functions
R2Measures

R2Measures
Merge

Merge Multiple Data Frames or Data Tables
HmiscOverview

Overview of Hmisc Library
Lag

Lag a Numeric, Character, or Factor Vector
GiniMd

Gini's Mean Difference
Cs

Character strings from unquoted names
Ecdf

Empirical Cumulative Distribution Plot
Save

Faciliate Use of save and load to Remote Directories
Misc

Miscellaneous Functions
addggLayers

addggLayers
aregImpute

Multiple Imputation using Additive Regression, Bootstrapping, and Predictive Mean Matching
all.is.numeric

Check if All Elements in Character Vector are Numeric
addMarginal

Add Marginal Observations
areg

Additive Regression with Optimal Transformations on Both Sides using Canonical Variates
binconf

Confidence Intervals for Binomial Probabilities
abs.error.pred

Indexes of Absolute Prediction Error for Linear Models
approxExtrap

Linear Extrapolation
biVar

Bivariate Summaries Computed Separately by a Series of Predictors
bootkm

Bootstrap Kaplan-Meier Estimates
ciapower

Power of Interaction Test for Exponential Survival
completer

completer
combine.levels

combine.levels
bpower

Power and Sample Size for Two-Sample Binomial Test
consolidate

Element Merging
combplotp

Combination Plot
bpplot

Box-percentile plots
cnvrt.coords

Convert between the 5 different coordinate sytems on a graphical device
capitalize

capitalize the first letter of a string
bystats

Statistics by Categories
dataRep

Representativeness of Observations in a Data Set
csv.get

Read Comma-Separated Text Data Files
describe

Concise Statistical Description of a Vector, Matrix, Data Frame, or Formula
contents

Metadata for a Data Frame
deff

Design Effect and Intra-cluster Correlation
curveRep

Representative Curves
cpower

Power of Cox/log-rank Two-Sample Test
cut2

Cut a Numeric Variable into Intervals
discrete

Discrete Vector tools
data.frame.create.modify.check

Tips for Creating, Modifying, and Checking Data Frames
ecdfSteps

ecdfSteps
escapeRegex

Escapes any characters that would have special meaning in a reqular expression.
ebpcomp

ebpcomp
dotchart2

Enhanced Dot Chart
dotchart3

Enhanced Version of dotchart Function
equalBins

Multicolumn Formating
dotchartpl

Enhanced Version of dotchart Function for plotly
estSeqMarkovOrd

estSeqMarkovOrd
mhgr

Miscellaneous Functions for Epidemiology
errbar

Plot Error Bars
event.convert

Event Conversion for Time-to-Event Data
extractlabs

extractlabs
fImport

fImport
estSeqSim

estSeqSim
event.history

Produces event.history graph for survival data
first.word

First Word in a String or Expression
find.matches

Find Close Matches
format.df

Format a Data Frame or Matrix for LaTeX or HTML
format.pval

Format P Values
event.chart

Flexible Event Chart for Time-to-Event Data
ggplotlyr

ggplotlyr
getZip

Open a Zip File From a URL
getabd

getabd
colorFacet

Miscellaneous ggplot2 and grid Helper Functions
hashCheck

hashCheck
getHdata

Download and Install Datasets for Hmisc, rms, and Statistical Modeling
ggfreqScatter

Frequency Scatterplot
gbayes

Gaussian Bayesian Posterior and Predictive Distributions
gbayesSeqSim

gbayesSeqSim
histboxp

Use plotly to Draw Stratified Spike Histogram and Box Plot Statistics
getRs

Interact with github rscripts Project
hist.data.frame

Histograms for Variables in a Data Frame
hdquantile

Harrell-Davis Distribution-Free Quantile Estimator
histbackback

Back to Back Histograms
hlabs

hlabs
html

Convert an S object to HTML
hlab

hlab
hoeffd

Matrix of Hoeffding's D Statistics
hidingTOC

Moving and Hiding Table of Contents
htmltabv

htmltabc
intMarkovOrd

intMarkovOrd
impute

Generic Functions and Methods for Imputation
latexDotchart

Enhanced Dot Chart for LaTeX Picture Environment with epic
knitrSet

knitr Setup and plotly Service Function
labcurve

Label Curves, Make Keys, and Interactively Draw Points and Curves
latexTabular

Convert a Data Frame or Matrix to a LaTeX Tabular
latex

Convert an S object to LaTeX, and Related Utilities
label

Label Attribute of an Object
latestFile

latestFile
mgp.axis

Draw Axes With Side-Specific mgp Parameters
list.tree

Pretty-print the Structure of a Data Object
latexCheckOptions

Check whether the options for latex functions have been specified.
minor.tick

Minor Tick Marks
makeNstr

creates a string that is a repeat of a substring
mChoice

Methods for Storing and Analyzing Multiple Choice Variables
mdb.get

Read Tables in a Microsoft Access Database
mApply

Apply a Function to Rows of a Matrix or Vector
latexTherm

Create LaTeX Thermometers and Colored Needles
movStats

movStats
mtitle

Margin Titles
legendfunctions

Legend Creation Functions
multLines

Plot Multiple Lines
meltData

meltData
nobsY

Compute Number of Observations for Left Hand Side of Formula
nstr

Creates a string of arbitry length
nCoincident

nCoincident
na.delete

Row-wise Deletion na.action
%nin%

Find Matching (or Non-Matching) Elements
na.keep

Do-nothing na.action
pc1

First Principal Component
panel.bpplot

Box-Percentile Panel Function for Trellis
plot.princmp

plot.princmp
partition

Patitions an object into different sets
num.intercepts

Extract number of intercepts
plotCorrPrecision

Plot Precision of Estimate of Pearson Correlation Coefficient
plotCorrM

plotCorrM
na.detail.response

Detailed Response Variable Information
popower

Power and Sample Size for Ordinal Response
prnz

Print and Object with its Name
prselect

Selectively Print Lines of a Text Vector
princmp

princmp
plotlyM

plotly Multiple
qcrypt

qcrypt
pstamp

Date/Time/Directory Stamp the Current Plot
pairUpDiff

pairUpDiff
plsmo

Plot smoothed estimates
rcspline.plot

Plot Restricted Cubic Spline Function
print.princmp

print.princmp
rcorrp.cens

Rank Correlation for Paired Predictors with a Possibly Censored Response, and Integrated Discrimination Index
printL

printL
rcorr

Matrix of Correlations and P-values
print.char.list

prints a list of lists in a visually readable format.
rcorr.cens

Rank Correlation for Censored Data
rcspline.restate

Re-state Restricted Cubic Spline Function
reShape

Reshape Matrices and Serial Data
print.char.matrix

Function to print a matrix with stacked cells
redun

Redundancy Analysis
rcspline.eval

Restricted Cubic Spline Design Matrix
r2describe

r2describe
samplesize.bin

Sample Size for 2-sample Binomial
rMultinom

Generate Multinomial Random Variables with Varying Probabilities
scat1d

One-Dimensional Scatter Diagram, Spike Histogram, or Density
sasxport.get

Enhanced Importing of SAS Transport Files using read.xport
sedit

Character String Editing and Miscellaneous Character Handling Functions
score.binary

Score a Series of Binary Variables
seqFreq

seqFreq
simplifyDims

List Simplification
rlegend

Special Version of legend for R
rm.boot

Bootstrap Repeated Measurements Model
simMarkovOrd

simMarkovOrd
show.pch

Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
soprobMarkovOrd

soprobMarkovOrd
runParallel

runParallel
soprobMarkovOrdm

soprobMarkovOrdm
showPsfrag

Display image from psfrag LaTeX strings
string.bounding.box

Determine Dimensions of Strings
smean.sd

Compute Summary Statistics on a Vector
spss.get

Enhanced Importing of SPSS Files
src

Source a File from the Current Working Directory
runifChanged

runifChanged
stat_plsmo

Add a lowess smoother without counfidence bands.
stata.get

Enhanced Importing of STATA Files
string.break.line

Break a String into Many Lines at Newlines
solvet

solve Function with tol argument
simRegOrd

Simulate Power for Adjusted Ordinal Regression Two-Sample Test
stringDims

String Dimentions
subplot

Embed a new plot within an existing plot
somers2

Somers' Dxy Rank Correlation
spikecomp

spikecomp
spower

Simulate Power of 2-Sample Test for Survival under Complex Conditions
summarize

Summarize Scalars or Matrices by Cross-Classification
summaryRc

Graphical Summarization of Continuous Variables Against a Response
summaryM

Summarize Mixed Data Types vs. Groups
summaryS

Summarize Multiple Response Variables and Make Multipanel Scatter or Dot Plot
symbol.freq

Graphic Representation of a Frequency Table
summary.formula

Summarize Data for Making Tables and Plots
sys

Run Unix or Dos Depending on System
t.test.cluster

t-test for Clustered Data
summaryP

Multi-way Summary of Proportions
tabulr

Interface to Tabular Function
translate

Translate Vector or Matrix of Text Strings
trunc.POSIXt

Return the floor, ceiling, or rounded value of date or time to specified unit.
upFirst

Change First Letters to Upper Case
valueTags

Store Descriptive Information About an Object
units

Units Attribute of a Vector
transace

Additive Regression and Transformations using ace or avas
upData

Update a Data Frame or Cleanup a Data Frame after Importing
testCharDateTime

testCharDateTime
transcan

Transformations/Imputations using Canonical Variates
wtd.stats

Weighted Statistical Estimates
tex

function for use in graphs that are used with the psfrag package in LaTeX
varclus

Variable Clustering
vlab

vlab
xtfrm.labelled

Auxiliary Function Method for Sorting and Ranking
xy.group

Mean x vs. function of y in groups of x
yearDays

Get Number of Days in Year or Month
ynbind

Combine Variables in a Matrix
xYplot

xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands