*! version 1.0.0 PR 15Jan98.
program define _fracrep
* 1=descriptor e.g. FRACTIONAL POLNOMIAL
* 2=param descriptor e.g. df
* 3=param names e.g. powers
* Assumes existence of usual S_E_'s and $MFPdf, se, al, fd.

local desc "`1'"
local param "`2'"
local paramv "`3'"

local i 1
local l=length("`paramv'")
while `i'<=$S_E_nx {
	local l=max(`l',length("${S_E_k`i'}"))
	local i=`i'+1
}
local l=`l'+44
local title "Final multivariable `desc' model for $S_E_depv"
local lt=length("`title'")
di _n in gr "`title'"
di in gr _dup(`lt') "-"
di _n in gr "Variable |" _col(15) _dup(5) "-" _col(20) "Initial" /*
 */ _col(27) _dup(5) "-" _col(42) _dup(5) "-" _col(47) "Final" /*
 */ _col(52) _dup(5) "-"
di in gr _col(10) "| `param'"/*
 */ _col(21) "Select" /*
 */ _col(30) "Alpha" /*
 */ _col(39) "Status" /*
 */ _col(47) "`param'" /*
 */ _col(55) "`paramv'"
di in gr _dup(9) "-" "+" _dup(`l') "-"
local i 1
while `i'<=$S_E_nx {
	local pars ${S_E_k`i'}
	if "`pars'"=="" | "`pars'"=="." {
		local final 0
		local status out
		local pars
	}
	else {
		local status in
		local final ${MFPfd`i'}
	}
	local name ${S_E_x`i'}
	local skip=8-length("`name'")
	di in gr _skip(`skip') "`name' |" in ye /*
	 */ _col(15) ${MFPdf`i'} /*
	 */ _col(20) %7.4f ${MFPse`i'} /*
	 */ _col(29) %7.4f ${MFPal`i'} /*
	 */ _col(41) "`status'" /*
	 */ _col(49) "`final'" /*
	 */ _col(55) "`pars'"
	local i=`i'+1
}
di in gr _dup(9) "-" "+" _dup(`l') "-"
$S_E_cmd
di in gr "Deviance:" in ye %9.3f $S_E_dev in gr "."
end