Dear Brendan,
That's curious, because the use argument to hetcor() works fine for me (see
below). Is it possible that you tried to use this argument without
specifying a data frame as the first argument to hetcor? If so, please see
?hetcor. If not, it would help to have an example.
I hope this helps,
John
------------ snip -------------
set.seed(12345) # adapting the example in ?hetcor
R <- matrix(0, 4, 4)
R[upper.tri(R)] <- runif(6)
diag(R) <- 1
R <- cov2cor(t(R) %*% R)
round(R, 4) # population correlations
Two-Step Estimates
Correlations/Type of Correlation:
x1 x2 y1 y2
x1 1 Pearson Polyserial Polyserial
x2 0.5932 1 Polyserial Polyserial
y1 0.5952 0.7409 1 Polychoric
y2 0.624 0.6317 0.5711 1
Standard Errors/Numbers of Observations:
x1 x2 y1 y2
x1 999 999 999 999
x2 0.02053 1000 1000 1000
y1 0.03092 0.02295 1000 1000
y2 0.02027 0.01994 0.03738 1000
P-values for Tests of Bivariate Normality:
x1 x2 y1
x1
x2 0.4952
y1 0.4023 0.878
y2 0.1166 0.5255 0.05615
--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox
--------------------------------
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of BRENDAN KLICK
Sent: Friday, December 01, 2006 1:42 PM
To: r-help at stat.math.ethz.ch
Subject: [R] error in hetcor function (polycor package)?
I have been using the hetcor function in the polycor package.
When I don't specify the use option everything runs
smoothly. However, when I specify use either as
"pairwise.complete.obs" or "complete.obs" I get this error
Error in optim(rho, f, control = control, hessian = TRUE, method =
"BFGS") :
non-finite value supplied by optim
Is this an error in the hetcor function or am I missing something.
Thanks for your help.
Brendan Klick
Johns Hopkins University School of Medicine bklick1 at jhmi.edu
[[alternative HTML version deleted]]