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

📄 yxyxview_g.class

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 CLASS
字号:
//                                 yxyxview_g
//
//	Base class for data views that have two x variables, two y variables 
//	and possibly a weight variable

*! version 1.0.0  14feb2005

version 9

class {
	type	= .yxyxtype.new	, style(pcspike)
	headlbl	= .yesno.new	, style(no)

	double x2var				// x2 variable id
	double y2var				// y2 variable id

} , inherit(yxview)


// ---------------------------------------------------------------------------
program set

	syntax [ , XBvar(string) YBvar(string) * ]

	.Super.set , `options'

	foreach dim in x y {
		if `"``dim'bvar'"' != `""' {

			capture confirm integer number ``dim'bvar'
			if _rc {
				local varid = `.serset.seriesof ``dim'bvar''
				if 0`varid' {
					.`dim'2var = `varid'
				}
				else {
				 di in white `"``dim'bvar' not found in serset"'
				}
			}
			else {
				.`dim'2var = ``dim'bvar'
			}
		}
	}

end


// ---------------------------------------------------------------------------
//	Returns the value of y2 for the specified observation
//
//	Usage:  .Y2 #_obs

program Y2
	.serset.set

	class exit = serset(`.y2var', `1')
end


// ---------------------------------------------------------------------------
//	Returns the value of x2 for the specified observation
//
//	Usage:  .X2 #_obs

program X2
	.serset.set

	class exit = serset(`.x2var', `1')
end


// ---------------------------------------------------------------------------
//	Returns minimum and maximum sizes

program ranges , rclass

	capture return scalar xmin = min(`.serset.sers[`.xvar'].min' ,	///
					 `.serset.sers[`.x2var'].min')
	capture return scalar xmax = max(`.serset.sers[`.xvar'].max' ,	///
					 `.serset.sers[`.x2var'].max')
	capture return scalar ymin = min(`.serset.sers[`.yvar'].min' ,	///
					 `.serset.sers[`.y2var'].min')
	capture return scalar ymax = max(`.serset.sers[`.yvar'].max' ,	///
					 `.serset.sers[`.y2var'].max')

	if "`.bar_drop_to.stylename'" == "y" {
		capture local xmin = return(ymin)
		capture local xmax = return(ymax)

		capture return scalar ymin = return(xmin)
		capture return scalar ymax = return(xmax)
		capture return scalar xmin = `xmin'
		capture return scalar xmax = `xmax'
	}

/*
	if `.base' < . {
		local ord = cond("`.bar_drop_to.snm"=="y", "x", "y")

		capture return scalar `ord'min = min(return(`ord'min) , `.base')
		capture return scalar `ord'max = max(return(`ord'max) , `.base')
	}
*/
end


// ---------------------------------------------------------------------------
//	Returns a key object of the view

program newkey

	syntax [anything] [ , Position(passthru) ]
							// anything ignored

	class exit .yxyxkey_g.new , view(`.objkey') `position'
end

// ---------------------------------------------------------------------------
//	Returns the label of the specified dimension variable, or if that is 
//	blank the name of the <dim>variable.  Optionally, returns only the name.
//
//      Note that the y-label will be <y_label>/<y2_label> unless both y
//      variables have the same label and the same is true for x-labels


program dimtitle

	gettoken dim 0 : 0

	syntax [ , Nameonly Keynum(integer 1) ]		// keynum ignored

	if "`.bar_drop_to.stylename'" == "y" {
		local dim = cond("`dim'" == "x" , "y", "x")
	}

	if ! `.Local.serset.isofclass serset' {
		exit
	}

	if "`nameonly'" == "" {
	    local label `"`.serset.sers[`.`dim'var'].label_or_name'"'
	    if `"`label'"' != `"`.serset.sers[`.`dim'2var'].label_or_name'"' {
	      local label `"`label'/`.serset.sers[`.`dim'2var'].label_or_name'"'
	    }
	}
	else {
	    local label `"`.serset.sers[`.`dim'var'].name'"'
	    local label `"`label'/`.serset.sers[`.`dim'2var'].name'"'
	}

	class exit `"`label'"'
end

// ---------------------------------------------------------------------------

//  Picks up .draw (switcher program from yxview)

⌨️ 快捷键说明

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