Description Usage Arguments Value Author(s) See Also Examples
This function is meant for creating correlation tables of one variable with multiple other variables
1 2 3 4 5 6 7 8 9 10 11 12 13 |
data |
The data frame that all the variables are found |
yvar |
String of the name in the data frame for the 'response' variable |
xvec |
Vector of strings giving the names in the data frame for the other variables to be correlated with yvar |
factor |
Vector for a two-level variable that can be used to seperate the data and have a test for differences in correlations based on Fisher's Z-transformation |
colNames |
Manually put in the names for the columns of the table produced. If factor is null and printPVals is FALSE ncol=3. If factor is null and printPVals is TRUE ncol=4. If factor is not null and printPVals is FALSE ncol=7 (printPVals TRUE, ncol=8). |
printPVals |
Logical: Is forced to FALSE if no factor is provided |
method |
Method to be used in the call of the cor() function |
LatexFileName |
File name for the LaTeX table that is created using uwLatex() |
returnMat |
Logical: Do you want the matrix to be printed in R |
digits |
Number of decimals to be printed |
... |
Other arguments that can be passed to uwLatex(). cgroup and n.cgroup is already set |
Output is the matrix that is created and used by uwLatex(). Code for the LaTeX table is also written to LatexFileName
Scott Hetzel M.S. University of Wisconsin-Madison Biostatistics and Medical Informatics Department
uwLatex()
1 2 3 4 5 6 7 8 9 10 11 | weight <- rnorm(100, 200, 10)
height <- rnorm(100, 72, 5)
bmi <- (weight / (height^2)) * 703
fact <- rep(c("Yes", "No"), c(50, 50))
df <- data.frame(weight, height, bmi, fact)
uwCorTab(df,
yvar = "bmi", xvec = c("weight", "height"), factor = "fact",
LatexFileName = paste(getwd(), "/uwCorTab.tex", sep = "")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.