Category Archives: MineQuest Business Analytics

PROC REG WPS v3.2–New Graphics and PMML

So, those of you who have downloaded WPS v3.2, there are a number of new features. I want to show two new features using PROC REG. WPS now has the ability to create plots for PROC REG. Quite handy indeed!

Also, in Proc REG for v3.2, we see experimental support for PMML (Predictive Model Markup Language).

Here is some sample code that demonstrates the plots.

*–> Data is census population data from 1790 to 2010;
data census;
   input year pop @@;
   pop2 = Round(Pop/1000000,.1);
   popsq=pop2*pop2;
   lpop=lag(pop2);
cards;
1790 3929214 1800 5308483 1810 7239881 1820 9638453 1830 12860702 1840 17063353
1850 23191876 1860 31443321 1870 38558371 1880 50189209 1890 62979766 1900 76212168
1910 92228496 1920 106021537 1930 123202624 1940 142164569 1950 161325798
1960 189323175 1970 213302031 1980 236542199 1990 258709873 2000 291421906 2010 308745538
;;;;
run;

*–> PROC REG with the PMML attribute to output the model in PMML form.;

filename outfile ‘c:\temp\regpmml.txt’;
Proc Reg data=census outpmml=outfile pmmlver=”4_2″ plots;
model pop2 = year lpop;
Title “US Census Population – PROC REG”;
run;

 

US Census Population – PROC REG
The REG Procedure
Model: MODEL1
Dependent variable: pop2

Number of Observations Read 23
Number of Observations Used 22
Number of Observations with Missing Values 1

Analysis of Variance
Source DF Sum of Squares Mean Square F Value Pr > F
Model 2 206768 103384 9307.59 <.0001
Error 19 211.04266 11.10751    
Corrected Total 21 206979      

Root MSE 3.332793 R-Square 0.998980
Dependent Mean 111.704545 Adj R-Sq 0.998873
Coeff Var 2.983579    

Parameter Estimates
Variable DF Parameter Estimate Standard Error t Value Pr > |t|
Intercept 1 -299.75395 71.30929 -4.20 0.0005
year 1 0.16607 0.03878 4.28 0.0004
lpop 1 0.97176 0.02754 35.28 <.0001

ResidualPlot2

DiagnosticsPanel3
 

The PMML output generated is:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<PMML version=”4.2″ xmlns=”
http://www.dmg.org/PMML-4_2″>
    <Header copyright=”World Programming Limited 2002-2015″>
        <Application name=”World Programming System (WPS)” version=”3.2.0″/>
    </Header>
    <DataDictionary numbeOfFields=”5″>
        <DataField name=”year” optype=”continuous” dataType=”double”/>
        <DataField name=”pop” optype=”continuous” dataType=”double”/>
        <DataField name=”pop2″ optype=”continuous” dataType=”double”/>
        <DataField name=”popsq” optype=”continuous” dataType=”double”/>
        <DataField name=”lpop” optype=”continuous” dataType=”double”/>
    </DataDictionary>
    <RegressionModel functionName=”regression” targetFieldName=”pop2″>
        <MiningSchema>
            <MiningField name=”year”/>
            <MiningField name=”lpop”/>
            <MiningField name=”pop2″ usageType=”target”/>
        </MiningSchema>
        <RegressionTable intercept=”-299.753951850233″>
            <NumericPredictor name=”year” coefficient=”0.166074316077245″/>
            <NumericPredictor name=”lpop” coefficient=”0.971762137737628″/>
        </RegressionTable>
    </RegressionModel>
</PMML>

Interested in a free 30 day evaluation of WPS? If your organization is located in North America, simply fill out the Evaluation Request from our website.

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in beautiful Tucson Arizona. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.

Possible Office Expansion – Westward Ho!

As a company, we’ve been looking at expanding our footprint to the Western United States. Some reasons for it are purely selfish, a few are health related and some of the reasons deal with doing business with organizations that are two or three hours different in terms of time with the Eastern United States.

I want to start writing a few blog posts about this endeavor. We’ve been looking at opening an office in Tucson, AZ and even though the geography is strikingly beautiful, the realities of opening a business in Tucson is strikingly difficult.

Tucson is not very business friendly.

True. This city is known for its open hostility to businesses. This is well known out in the Western United States but not so much back in the Midwest or Eastern U.S. Tucson is basically a resort town with a few limited large businesses. The large employers seem to be University of Arizona, Raytheon (a missile systems developer), a medical complex and City and County Government. Note how many of the mentioned are either government entities or are attached to government funding. In other words, they tend not to create or produce capital but instead consume capital.

University of Arizona (UA) is probably the jewel in the city. But what is sad is that the vast majority of students who graduate from UA, cannot find a job in Tucson. They are forced to look for work in Phoenix, Los Angeles and the State of Texas. I guess there’s nothing smarter than spending the money to educate them and then throwing them out of the nest to seek work and develop products elsewhere!

Taxes are a mess. We still have not figured out what kind of states sales tax we would have to charge if we opened a business in Tucson. Each jurisdiction has a different sales tax rate and figuring out what your jurisdiction is (Tucson incorporated, unincorporated, are you north or south of River Road) is really tough. We’ve called twice and gotten two different answers. It also seems that sales taxes or Transaction Privileges Tax can change from month-to-month. If you go to the Tucsonaz.gov website, you will see tax tables for February and March.

As a small business or mid-sized business, we don’t want to spend our time trying to figure out how much the privilege costs us to sell a product from month-to-month. Also, when you compete nationally as well as globally, taxes have a big impact on your customers. Taxes have to be passed through to the customer if you want to survive.

The Transaction Privilege Tax Sales taxes is very high. Local municipalities add their own tax on to the state tax and when combined can be astronomical! In Tucson, you pay 8.1% sales tax. Probably one of the highest in the country.

There’s also a huge disconnect between the politicians/bureaucrats and the small business owners here in Tucson. We’ve talked to lots of small and mid-sized business owners and upper level managers, and just about every person we’ve talked with has felt that city and county government is a significant hindrance to the success of Tucson and the business economy.

One thing that I can’t stand is for folks to criticize and not offer suggestions or some possible solutions to the issues. So here are a few to start the discussion.

Suggestions for Improvement

The City has to become more business friendly. They are not going to be able to grow or even sustain the current economy unless they can bring in business from the outside. They cannot grow the economy to the level they need by developing the existing businesses.

Create a One Stop Business Center where potential companies can go to get the correct answers on what taxes they have to pay, the amount of sales taxes they have to pay, the licensing that is required, and other filing requirements. The city and county should set up a little store front that is in conjunction with companies like Comcast, Bank of America, the phone company, Office Max/Office Depot where there is an all-in-one business center. Here you can find out what kind of licensing, permits and taxes that you will be required to attain and pay. The private sector companies can have a small footprint to help new and even existing companies find out about services that they will most likely need and to sign them up. What company doesn’t need internet and banking services? We have not been able to locate such a source and as such, feel that the risks are quite high that we would miss something and be liable for fines and penalties.

Tucson should take a look at neighboring communities and see what is working for them. We see a huge difference between Oro Valley or the city of Marana in contrast to Tucson in terms of business climate and health. We have been steered many times to these communities by realtors, lawyers and bankers as the place you want to be in locating a small or midsized business.

Accentuate the positive. Craft a national story about how the educational resources (UA) is an asset to growing technology businesses. Talk about what kind of research is being done at the local level and by small businesses in the area. Talk up success stories. Discuss the low cost to lease office space.

Advertise in major publications like Fortune, Forbes and Bloomberg about Tucson and the business opportunities and the resources available in Tucson.

Do something about the sour state of education in the area. Elementary and High School is poorly funded. Same goes for community colleges. As a matter of fact, we just learned that the state of Arizona has stopped all funding of community colleges except for one county. As a business owner, I don’t want to have pay to attract talent from other states and help pay relocation costs. Support for education has to become a priority over support for state prisons.

Take advantage of the contacts and expertise of the Snow Birds and other wealth that is located in the Catalina Foothills. There is some amazing wealth in the Foothills. We’ve met folks who have run and sold large businesses who spend time in the Foothills who are worth tens and hundreds of millions of dollars. They grimace and grin almost as if it’s sport at the missteps that the city and county have taken in the last decade or two as it pertains to creating a viable and sustaining local economy. These folks are amazingly well networked and have the ability to move businesses here as well as encourage businesses to locate here.

Poach businesses from other States. Property taxes are very low in Arizona. Businesses are sensitive to labor rates, real estate costs, property taxes and educational resources for their employees as well as for the growth of the business. Tucson needs to set up a highly visible group that does nothing but pursue large companies to relocate to the area. Start raiding California for the technology companies by offering tax incentives as well as building an environment for cross-pollination of ideas, networking, concierge services for new businesses, free site location services, seven day permit approvals, etc…

Finally

The two questions I have to ask Tucson is “Does a Liberal leaning political government mean that it has to be at odds over the creation of jobs or even synonymous with the lack of jobs? Is there a conflict over creation of wealth by attracting small and mid-sized businesses and does that inherently mean that there’s an ever expanding gap of those who have vs. those who have not?” It doesn’t appear to be that way for liberal cities like San Francisco or Seattle, but it does seem that way for Tucson.

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in Grand Rapids, Michigan. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.

WPS for Workstations

In the last few weeks, we put together a document that describes the World Programming System for workstations and desktops. The document describes some of the licensing behind WPS and what procedures and database engines are supported.

If you are considering a WPS solution and want some detailed background on the product before purchasing a WPS Workstation license, this document should help.

You can download the Product Overview from our website by clicking the link below.

Product Overview – WPS for Workstations (1.02MB PDF)

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in Grand Rapids, Michigan. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.

Calculating Driving Distances with WPS and the Bridge to R

A few weeks ago, there was a posting on SAS-L where the poster was attempting to get the driving distance between two cities using google’s mapping services. I found that a rather interesting question and decided to see what I could do using WPS and the Bridge to R.

For those who are unfamiliar with the Bridge to R, it is a product from MineQuest Business Analytics that allows you to execute R statements from within the WPS environment. You can pass WPS datasets to R and return R frames to WPS quite easily. You also get the R log and list files returned to your WPS session in the corresponding log and list windows.

Here is the code that we used to create a driving distance matrix between three cities. The output is printed using the PROC Print statement in WPS. 

*--> data set for drive distances;
data rdset;
input fromdest $1-17 todest $ 20-36;
cards;
Grand Rapids, MI   State College, PA
Columbus, OH       Grand Rapids, MI
Chicago, IL        Grand Rapids, MI
;;;;
run;


%Rstart(dataformat=csv,data=rdset,rGraphicsFile=);
datalines4;

    attach(rdset)
    library(ggmap)

    from <- as.character(fromdest)
    to  <- as.character(todest)

    mydist <- mapdist(from,to)

;;;;
%rstop(import=mydist);

proc print data=mydist(drop=var2);
format m comma10. km comma 8.2 miles 8.2 seconds comma7. minutes comma8.2 hours 6.2;
run;

And this is the output:

      Obs    from                  to                              m          km       miles    seconds     minutes     hours       
                                                                                                                                    
       1     Grand Rapids, MI      State College, PA         843,978      843.98      524.45     28,256      470.93      7.85       
       2     Columbus, OH          Grand Rapids, MI          521,289      521.29      323.93     17,543      292.38      4.87       
       3     Chicago, IL           Grand Rapids, MI          285,836      285.84      177.62      9,695      161.58      2.69       
                                                                                                                             

So you can see how handy WPS and the Bridge2 to R can be as a resource – kind of a Swiss Army knife if you like.

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in Grand Rapids, Michigan. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.

On ErrorAbend

One issue I always had with the SAS system as a developer was when I had a job that ran in batch that had an error. The SAS System would set the number of observations to zero and go into syntax checking mode for the remainder of the program.

This had some virtues but more often than not, the error was thrown because I had misspelled a variable name in a MEANS statement or FREQ statement that was used for checking my output. This would cause SAS to go into the syntax checking mode and all the rest of my program would not execute even though it was proper.

WPS, when running in batch doesn’t do this but if you want the same effect for your batch jobs, it’s easy enough to implement. Consider the following macro – called %ErrorAbend. %ErrorAbend simply checks that the program is not running in the FOREground and checks the value of the &syserr variable after every PROC or data step and if it returns a value of 3, then issues a note and sets the number of observations to zero.

%macro onerrorabend;
  %if %eval(&syserr eq 3) and &sysenv NE FORE %then %do;
     options obs=0;
     %put NOTE: WPS has been set with OPTION OBS=0 and will continue to check statements.
  %end;
%mend;

Below is a sample program that when run in batch, puts the system into syntax checking mode and basically stops the execution of any downstream statements.

data a b;
do ii=1 to 2000;
  x=ranuni(0)* 10;
  y=Round(ranuni(0),.01)* 100;
  z=round(ranuni(0),.01)* 10000;
  

  a=ranuni(0)* 10;
  b=Round(ranuni(0),.01)* 100;
  c=round(ranuni(0),.01)* 10000;
  
  e=ranuni(0)* 10;
  f=Round(ranuni(0),.01)* 100;
  g=round(ranuni(0),.01)* 10000;
  
  i=ranuni(0)* 10;
  j=Round(ranuni(0),.01)* 100;
  k=round(ranuni(0),.01)* 10000;

  output;
end;
run;

proc freq data=a;
tables ik;
run;

%onerrorabend;


proc means data=b;
run;

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in Grand Rapids, Michigan. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.

2013 WPS and SAS Server Pricing Comparison

It’s that time of the year again. We’ve updated our ever popular WPS vs. SAS Pricing Comparison document for 2013. As in previous years, we pulled data for SAS pricing from the GSA schedule. As most of you who have read previous years pricing comparisons, WPS continues to stay significantly less expensive than our competitor.

The pricing differential for even our most entry level server product in contrast with our competitor is stunning. For example, with the money you can save in the very first year in licensing WPS over SAS on just a two core server, you could:

  • Buy 5 Kia Souls.
  • Pay for food for a family of four for 7.5 years.
  • Will buy four years of in-state tuition and room and board at Ohio State University.
  • Buys 27 years worth of gasoline for the average U.S family.
  • You could add an employee to your company.
  • Buys 24 months of a high end vacation rental home that has a Jacuzzi and lap pool.

OK, you get the point! Click the following link for the updated “Pricing Comparison Document” in PDF format.

Note: We no longer provide the pricing comparison document due to the time and complexity of pulling our competitors pricing data.

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in Grand Rapids, Michigan. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS and SAS consulting and contract programming services and is a authorized reseller of WPS in North America.