Skip to content

error in hetcor function (polycor package)?

3 messages · BRENDAN KLICK, John Fox

#
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 -------------
[,1]   [,2]   [,3]   [,4]
[1,] 1.0000 0.5848 0.5718 0.6233
[2,] 0.5848 1.0000 0.7374 0.6249
[3,] 0.5718 0.7374 1.0000 0.5923
[4,] 0.6233 0.6249 0.5923 1.0000
[,1]   [,2]   [,3]   [,4]
[1,] 1.0000 0.5933 0.5659 0.6088
[2,] 0.5933 1.0000 0.7334 0.6230
[3,] 0.5659 0.7334 1.0000 0.5802
[4,] 0.6088 0.6230 0.5802 1.0000
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.6316     0.5708          1

Standard Errors:
        x1      x2     y1
x1                       
x2 0.02053               
y1 0.03092 0.02296       
y2 0.02027 0.01995 0.0374

n = 999 

P-values for Tests of Bivariate Normality:
       x1     x2      y1
x1                      
x2 0.4782               
y1 0.4023 0.8871        
y2 0.1166 0.5077 0.05526
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.6316     0.5708          1

Standard Errors:
        x1      x2     y1
x1                       
x2 0.02053               
y1 0.03092 0.02296       
y2 0.02027 0.01995 0.0374

n = 999 

P-values for Tests of Bivariate Normality:
       x1     x2      y1
x1                      
x2 0.4782               
y1 0.4023 0.8871        
y2 0.1166 0.5077 0.05526
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 
--------------------------------
#
Yes, that's it.

 hetcor(x1, x2, y1, y2) 
 hetcor(data, use="pairwise.complete.obs")

works but

 hetcor(x1, x2, y1, y2, use="complete.obs") 
 hetcor(x1, x2, y1, y2, use="pairwise.complete.obs") 

do not.  Thanks very much!

Brendan
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 -------------
[,1]   [,2]   [,3]   [,4]
[1,] 1.0000 0.5848 0.5718 0.6233
[2,] 0.5848 1.0000 0.7374 0.6249
[3,] 0.5718 0.7374 1.0000 0.5923
[4,] 0.6233 0.6249 0.5923 1.0000
[,1]   [,2]   [,3]   [,4]
[1,] 1.0000 0.5933 0.5659 0.6088
[2,] 0.5933 1.0000 0.7334 0.6230
[3,] 0.5659 0.7334 1.0000 0.5802
[4,] 0.6088 0.6230 0.5802 1.0000
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.6316     0.5708          1

Standard Errors:
        x1      x2     y1
x1                       
x2 0.02053               
y1 0.03092 0.02296       
y2 0.02027 0.01995 0.0374

n = 999 

P-values for Tests of Bivariate Normality:
       x1     x2      y1
x1                      
x2 0.4782               
y1 0.4023 0.8871        
y2 0.1166 0.5077 0.05526
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.6316     0.5708          1

Standard Errors:
        x1      x2     y1
x1                       
x2 0.02053               
y1 0.03092 0.02296       
y2 0.02027 0.01995 0.0374

n = 999 

P-values for Tests of Bivariate Normality:
       x1     x2      y1
x1                      
x2 0.4782               
y1 0.4023 0.8871        
y2 0.1166 0.5077 0.05526
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 
--------------------------------