*! version 1.0  29aug2024
program magreg, eclass
	if !replay() {
		syntax varlist(ts fv) [if] [in] [aw fw iw pw] [,   ///
		BSopts(string)                                     /// Bootstrap options
		NOCONStant                                         ///
		Level(cilevel)                                     ///
		*                                                  /// Display options
		]

		_get_diopts diopts, `options'

		quietly bootstrap, `bsopts':                       ///
		         magreg_est `varlist' `if' `in' [`weight'`exp'], `noconstant'
		}
	else {
		if strpos("`e(cmdline)'","magreg_est ")==0 error 301
		if strpos("`options'","vce")!=0 error "option vce not allowed"
		}
	display _n as txt "Maximum agreement regression" _c
	display _col(44) as txt "Number of obs           = " as res %9.0f e(N)
	display _col(44) as txt "R-squared               = " as res %9.4f e(r2)
	display _col(44) as txt "Replications            = " as res  %9.0f e(N_reps)
	display _col(44) as txt "Concordance corr. coef. = " as res %9.4f sqrt(e(r2))
	_coef_table, level(`level') `diopts'
end