Generating R Command for any cufunction
You may find this helpful in getting a cufunction to do exactly what you want,
especially when you are new or are rusty.
Choose the cufunction you want to use:
curead read clipboard data and assign to datasetname
cutable1 summary table, optional Box plots
cu1way continuous/categorical var compared across groups
cu2way continuous/categorical var - 2 fixed factors
cucov1way continuous - 1 cont. covariate, 1 fixed factor
cucov2way continuous - 1 cont. covariate, 2 fixed factors
curepmeas continuous/categorical - repeated measure, optional: 2nd factor, covariates
culinreg continuous - multiple linear regression, explore all models
cukm Kaplan-Meier survival analysis
culogist categorical - multiple logistic regression, explore all models
cucox time to event on multiple baseline factors - Cox modeling, explore all models
In Excel, highlight and copy data (with variable names in top line), then
in RStudio,
dataset-name
= curead()
To skip
N
lines before variable names line,
dataset-name
= curead(skip=
N
)
To read
M
lines of data after variable names line,
dataset-name
= curead(nrows=
M
)
You cannot copy/paste curead since your clipboard already contains your data.
For cutable1, cu1way, cu2way, cucov1way, cucov2way, cuscatter:
Just once in a session,
attach(
dataset-name
)
No need to attach for curepmeas, culinreg, culogist, cucox
Variable or Dataset being summarized:
Grouping variable (optional):
Just mean/SD or median/IQR (
brief
):
plot
type: // repeated for 12way
box
bar
violin
rod
no
Include All column (
doAll
):
compare
groups:
Threshold p-value (
psignif
) to show for comparisons:
Correlate all continuous variables (
docorr
):
Threshold p-value (
pnorm
) for mean vs median:
SD/IQR on same row (
sdsamerow
):
IQR separator (if not comma):
Display data points on graph (
dots
):
ebars
:
1 (Mean,SD)
2 (Mean,SE)
3 (Mean,CI)
4 (Median,IQR)
(Optional) diff. x-axis label for grouping variable (no quotes) (
g1name
):
graph to disk: hires (eps/pdf/jpg/jpeg/tiff/png) or editable on Mac (emf):
Remember, just once in a session, to
attach(
your-dataset-name
)
R command to copy/paste:
Variable being compared across groups:
First g
rouping variable:
Second grouping variable:
Interaction between the two factor variables (
interact
):
Continuous covariate:
If slopes differ, enter covariate values at which to compare groups:
(Optional) Break-point x-value where slope may change (
breakpt
):
plot
type:
bar
violin
box
rod
no
Display data points on bar graph (
dots
):
ebars
:
1 (post-hoc t, SD)
2 (post-hoc t, SE)
3 (post-hoc t, CI)
4 (nonparametric Dunn)
scale
(for categorical data):
frequency
percent
Following nuanced options may be safely ignored if a novice.
Adjustment for multiple comparisons (
padj
):
none
Bonferroni
Holm
Threshold p-value (
psignif
) for Compact Letter Display (0 for no CLD):
Bar colors (
fill
):
multicolor
grey
black
Width of confidence interval, specify in decimal - 95% is 0.95 (
conf.int
):
Parameter to control (
width
) of bars:
Change
yscale
from linear:
none
log2
log10
sqrt
To reorder bars, enter levels in ' ', sep.by commas (
order
):
For angled x-axis text (0 to 90) (
xangle
):
For angled y-axis text (0 to 90) (
yangle
):
Switch
orientation
to horizontal:
Optional
caption
for bars (
yes
to display n's):
Dependent variable name to appear in graph as:
I
Grouping variable name to appear in graph as:
II Grouping variable name to appear in graph as:
Title to appear in graph as:
Locating the graph
legend
:
top
bottom
right
left
Parameter to control (
size
) of points and outlines:
graph to disk: hires (eps/pdf/jpg/jpeg/tiff/png) or editable on Mac (emf):
Remember, just once in a session, to
attach(
your-dataset-name
)
R command to copy/paste:
Time variable:
Event variable:
Grouping variable:
Cumulative incidence instead of survival (
kmtype
):
Show p-value on graph (
showpval
):
Show censored points (
censor
):
Show percent on y-axis instead of fraction (
showpct
):
Where to show legend (
legend
):
program decides
bottom
left
right
graph to disk: hires (eps/pdf/jpg/jpeg/tiff/png) or editable on Mac (emf):
Remember, just once in a session, to
attach(
your-dataset-name
)
R command to copy/paste:
Dataset being analyzed (no quotes):
Time variable:
depvar
(no quotes):
Factor repeated within each subject (no quotes):
Optional grouping variable (no quotes):
Interaction between the repeated factor and grouping variable (
interact
):
Switch two factors on bar graph (
mainx
):
covlist
(no quotes, separated by plus sign +):
Model log-risk instead of log-odds (
lnklog
):
Predicted Kaplan-Meier curves (
dopredkm
):
(Optional) Change ROC times from 50,75,100% events (
doroc
):
(Optional) Change Cox cut-pts from quartiles for K-M (
docoxkm
):
Print fitted
fitvals
(
printfit
):
Number of decimals in fitted values (
ndecfit
):
Look at all possible models (
dodredge
):
Following nuanced options may be safely ignored if a novice.
Bar graph of differences (
sumdiff
):
none
each level minus first
first minus each level
Display data points on bar graph (
dots
):
ebars
:
1 (SD)
2 (SE)
3 (CI)
4 (Median/IQR)
Threshold p-value (
psignif
) for Compact Letter Display (0 for no CLD):
Bar colors (
fill
):
multicolor
grey
black
Width of confidence interval, specify in decimal - 95% is 0.95 (
conf.int
):
Dependent variable name to appear in graph as:
Repeated factor name to appear in graph as:
Optional grouping variable name to appear in graph as:
Parameter around 0.9 to fine-tune group2 bar spacing (
posd
):
Title to appear in graph as:
Locating the graph
legend
:
top
bottom
right
left
Parameter to control (
size
) of points and outlines:
Parameter to control (
width
) of bars:
Change
yscale
from linear:
none
log2
log10
sqrt
To reorder bars, enter levels in ' ', sep.by commas (
order
):
To reorder diff., levels in ' ', sep.by commas (
orderdiff
):
For angled x-axis text (0 to 90) (
xangle
):
For angled y-axis text (0 to 90) (
yangle
):
Switch
orientation
to horizontal:
dredge options
Model used is to be the
usemod
-th best in dredge output:
Dredge output to show the top
nmodshow
models:
Minimum number of variables in models looked at (
m.min
):
Maximum number of variables in models looked at (
m.max
):
Must-have variables (no c, each in quotes, sep.by commas) (
fixed
):
Complicated subsetting (
subset
):
graph to disk: hires (eps/pdf/jpg/jpeg/tiff/png) or editable on Mac (emf):
No need to attach(your-dataset-name)
R command to copy/paste: