R Kullback测试中的多变量回归不起作用

时间:2016-04-28 22:44:07

标签: r regression multivariate-testing

冒着这个有点含糊的问题的风险,我仍然会继续问它:

我在R中运行了一个带有两个结果变量的多元回归,并希望评估协方差矩阵的同质性,但是,唉,Kullback测试会抛出一个错误:

Sub macro1()

Dim rng As Range
Dim lastRow As Long
Dim book1 As Workbook
Dim book2 As Workbook
Dim sheet1 As Worksheet
Dim sheet2 As Worksheet

Set book1 = Workbooks("SSO_TFR_SUMMARY")
Set book2 = Workbooks("name of book here") 'change name
Set sheet1 = book1.WorkSheets("Sheet1")
Set sheet2 = book2.WorkSheets("Main Circuit")
Set rng = sheet2.Selection

lastRow = sheet1.Cells(sheet1.Rows.count, "D").End(xlUp).Row + 1

With sheet1

    .Cells(lastRow, 4).Value2 = sheet2.Cells(rng.Row, 15).Value2
    .Cells(lastRow, 5).Value2 = sheet2.Cells(rng.Row, 16).Value2
    .Cells(lastRow, 6).Value2 = sheet2.Cells(rng.Row, 6).Value2
    .Cells(lastRow, 7).Value2 = sheet2.Cells(rng.Row, 17).Value2

End With

End Sub

现在,x和y都是矩阵,所以我真的不知道该怎么做,并且会欣赏任何类型的输入。

Error in cov(Y[X == lev.X[k], ]) : 
  supply both 'x' and 'y' or a matrix-like 'x'

我希望这有助于说明问题。

0 个答案:

没有答案