print.polycor: Print Method for polycor Objects

Description Usage Arguments Value Author(s) See Also Examples

Description

print method for objects of class polycor, produced by polychor and polyserial.

Usage

1
2
## S3 method for class 'polycor'
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

x

an object of class polycor, as returned by polychor or polyserial.

digits

number of significant digits to be printed.

...

not used.

Value

Invisibly returns x; used for its side effect — i.e., printing.

Author(s)

John Fox [email protected]

See Also

polychor, polyserial

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if(require(mvtnorm)){
    set.seed(12345)
    data <- rmvnorm(1000, c(0, 0), matrix(c(1, .5, .5, 1), 2, 2))
    x <- data[,1]
    y <- data[,2]
    cor(x, y) # sample correlation
    }
if(require(mvtnorm)){
    x <- cut(x, c(-Inf, .75, Inf))
    y <- cut(y, c(-Inf, -1, .5, 1.5, Inf))
    polychor(x, y, ML=TRUE, std.err=TRUE)  # polychoric correlation, ML estimate
    }

Example output

Loading required package: mvtnorm
[1] 0.5263698

Polychoric Correlation, ML est. = 0.5231 (0.03819)
Test of bivariate normality: Chisquare = 2.739, df = 2, p = 0.2543

  Row Threshold
  Threshold Std.Err.
     0.7537  0.04403


  Column Thresholds
  Threshold Std.Err.
1   -0.9842  0.04746
2    0.4841  0.04127
3    1.5010  0.06118

polycor documentation built on May 30, 2017, 12:09 a.m.