'You can set the desired significance levels below, and the associated high-lighting asterisks.  You should set them such that plevel1>plevel2>plevel3.  If you do not want to use three different levels of significance you can set plevel3 or plevel2 to 0.

'Defaults
!plevel1 = 0.10   'first significance level
%plevel1star = "*"   'number of asterisks to use for plevel 1

!plevel2 = 0.05  'second sig level
%plevel2star = "**"

!plevel3 = 0.01 ' third sig level
%plevel3star = "***"

logmode +addin

'check for equation object
'check that an object exists
%type = @getthistype
if %type="NONE" then
	clearerrs
	@uiprompt("No object found, please open an EQUATION object")
	stop
endif


'check that _this object is an equation
if %type<>"EQUATION" then
	@uiprompt("Procedure can only be run from an EQUATION object")
	stop
endif
%ename = _this.@name
if %ename = "" then
	%ename = "_this"
endif


'parse options
if @len(@option(1)) then
	%temp = @equaloption("p1")
	if @len(%temp) then
		!plevel1 = @val(%temp)
	else
		!plevel1 = 0
	endif
	
	%temp = @equaloption("p1color")
	if @len(%temp) then
		%plevel1star = %temp
	endif


	%temp = @equaloption("p2")
	if @len(%temp) then
		!plevel2 = @val(%temp)
	else
		!plevel2 = 0
	endif
	
	%temp = @equaloption("p2color")
	if @len(%temp) then
		%plevel2star = %temp
	endif


	%temp = @equaloption("p3")
	if @len(%temp) then
		!plevel3 = @val(%temp)
	else
		!plevel3 = 0
	endif
	
	%temp = @equaloption("p3color")
	if @len(%temp) then
		%plevel3star = %temp
	endif

endif

'get the number of coefficients
!ncoefs = {%ename}.@ncoef

'find the row position of the coefficient output in the equation output.  Note this location can change, as different estimation methods have different sized header information.
%tname = @getnextname("_tname")
freeze({%tname}) {%ename}.stats
!rowloc=0
for !i=1 to 1000
	if {%tname}(!i,1) = "Variable" then
		!rowloc = !i
		!i=1001
	endif
next

'find the column position of the pvalues
!colloc = 0
for !i=1 to 10
	if {%tname}(!rowloc,!i) = "Prob.  " then
		!colloc = !i
		!i=11
	endif
next

'add 2 to the rowlocation to move down to the actual values
!rowloc = !rowloc + 2

'do the highlighting
for !i=!rowloc to !rowloc+!ncoefs-1
	!pval = @val({%tname}(!i,!colloc))
	if !pval < !plevel3 then
		{%tname}(!i,!colloc) = {%tname}(!i,!colloc)+%plevel3star
	  else if !pval < !plevel2 then
		{%tname}(!i,!colloc) = {%tname}(!i,!colloc)+%plevel2star
          else if !pval < !plevel1 then
		{%tname}(!i,!colloc) = {%tname}(!i,!colloc)+%plevel1star
          endif
        endif
	endif
next

{%ename}.display {%tname}
d {%tname}
