📄 _mds_euclidean.ado
字号:
*! version 1.0.0 12feb2005
program _mds_euclidean
args F colon Yexp
assert inlist(`"`colon'"', ":", "=")
tempname d Y
matrix `Y' = `Yexp'
local n = rowsof(`Y')
matrix `F' = J(`n',`n',0)
matrix rownames `F' = `:rownames `Y''
matrix colnames `F' = `:rownames `Y''
forvalues i = 1/`n' {
forvalues j = 1 / `=`i'-1' {
matrix `d' = `Y'[`i',1...]-`Y'[`j',1...]
matrix `d' = `d'*`d''
matrix `F'[`i',`j'] = sqrt(`d'[1,1])
matrix `F'[`j',`i'] = `F'[`i',`j']
}
}
end
exit
_mdseuclidean F {:|=} Y
computes a square matrix F with the euclidean distances between the rows of Y
the number of columns of Y is arbitrary
note that the diagonal of F is 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -