⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 factormat.ado

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 ADO
字号:
*! version 1.0.0  10feb2005
program factormat
	version 9

	if replay() {
		// replay using factor
		if "`e(cmd)'" != "factor" {
			dis as err "factor estimation result not found"
			exit 301
		}
		factor `0'
		exit
	}
	
	EstimateMatrix `0'
end


program EstimateMatrix, eclass
	#del ;
	syntax  anything(name=Cin id="correlation or covariance matrix"),
		n(numlist max=1 integer >= 1)
	[
		CORrelation // undocumented, but allowed (default/only choice)
		COVariance  // undocumented; to display err msg
		SHape(passthru)
		NAMes(passthru)
		SDS(passthru)
		MEAns(passthru)
		FORCE           // undocumented
		*
	] ;
	#del cr

	// purpose of sds() and means() is to pass along the std dev and means
	// so that -predict- can use the information.  They do not affect
	// -factormat- directly.

	local opts `options'
	
	if "`covariance'" != "" {
		dis as err "factor analysis of a covariance matrix " ///
		           "is currently not supported"
		exit 198
	}
	
// get moment statistics

	_getcovcorr `Cin' , correlation `names' `shape'	`sds' `means' `force'

	tempname C
	matrix `C' = r(C)
	local names : colnames `C'
	local Ctype `r(Ctype)'
	if "`r(sds)'" == "matrix" {
		tempname sds
		matrix `sds' = r(sds)
	}
	if "`r(means)'" == "matrix" {
		tempname means
		matrix `means' = r(means)
	}

// create a dataset with pseudo-data (in unit variables)
		
	capture noisily {

		quietly {
			if `n' == c(N) {
				capture confirm new var `names'
				local addvar = _rc==0
			}
			if "`addvar'" != "1" {
				preserve
				drop _all
				quietly set obs `n'
				local clear clear
			}
			corr2data `names' , corr(`C') n(`n') /// 
			   double `clear'
		}
		
		// and use the variable-based factor command
		factor `names' , `opts' cmatname(`Cin') 
	}
	
	nobreak {
		local rc = _rc
		if "`addvar'" == "1" {
			foreach v on local names {
				capture drop `v'
			}
		}
		if "`means'" != "" { 
			ereturn matrix means = `means' , copy
		}
		if "`sds'" != "" { 
			ereturn matrix sds = `sds' , copy
		}
		exit `rc'
	}
end
exit

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -