Description Usage Arguments Value Author(s) See Also Examples
wtd.cor
produces a Pearsons correlation coefficient comparing two variables or matrices. Note that weights run with the default parameters here treat the weights as an estimate of the precision of the information. For survey data, users should run this code with bootstrapped standard errors bootse=TRUE
, which are robust to heteroskadesticity, although these will vary slightly each time the weights are run. A prior version of this software was set to default to mean1=FALSE
and bootse=FALSE
.
1 2 |
x |
|
y |
|
weight |
|
mean1 |
|
collapse |
|
bootse |
|
bootp |
|
bootn |
|
A list with matrices for the estimated correlation coefficient, the standard error on that correlation coefficient, the t-value for that correlation coefficient, and the p value for the significance of the correlation. If the list can be simplified, simplification will be done.
Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
wtd.cors
stdz
wtd.t.test
wtd.chi.sq
1 2 3 4 5 6 7 |
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Attaching package: ‘Hmisc’
The following objects are masked from ‘package:base’:
format.pval, units
Loading required package: gdata
sh: 1: /usr/bin/perl: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.
gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.
Attaching package: ‘gdata’
The following object is masked from ‘package:stats’:
nobs
The following object is masked from ‘package:utils’:
object.size
The following object is masked from ‘package:base’:
startsWith
Loading required package: mice
Attaching package: ‘mice’
The following object is masked from ‘package:stats’:
filter
The following objects are masked from ‘package:base’:
cbind, rbind
Warning message:
In system(cmd, intern = TRUE) :
running command ''/usr/bin/perl' '/usr/lib/R/site-library/gdata/perl/supportedFormats.pl'' had status 126
correlation std.err t.value p.value
Y -0.8312236 0.1604855 -5.17943 0.0002295519
correlation std.err t.value p.value
Y -0.8108894 0.1689325 -4.800078 0.0004334788
correlation bootcor std.err t.value p.value
Y -0.8108894 NA NA NA NA
Warning messages:
1: In cor(x[q, ], y[q, ], use = "pairwise.complete.obs") :
the standard deviation is zero
2: In cor(x[q, ], y[q, ], use = "pairwise.complete.obs") :
the standard deviation is zero
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.