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

📄 y2xview_g.class

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

*! version 1.0.1  28apr2004

version 8

class {
	type	= .y2xtype.new,	     style(rspike)

	double y2var				// y2 variable id

} , inherit(yxview)


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

	syntax [ , YBvar(string) * ]

	.Super.set , `options'

	if `"`ybvar'"' != `""' {

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

end


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

program Y2
	.serset.set

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


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

program ranges , rclass

	capture return scalar xmin = `.serset.sers[`.xvar'].min'
	capture return scalar xmax = `.serset.sers[`.xvar'].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 .y2xkey_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.


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 "`dim'" == "y" {
		if `"`label'"' !=					///
		   `"`.serset.sers[`.y2var'].label_or_name'"' {
		    local label						///
			`"`label'/`.serset.sers[`.y2var'].label_or_name'"'
		}
	    }
	}
	else {
		local label `"`.serset.sers[`.`dim'var'].name'"'
		if "`dim'" == "y" {
			local label `"`label'/`.serset.sers[`.y2var'].name'"'
		}
	}

	class exit `"`label'"'
end

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

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

⌨️ 快捷键说明

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