svb for XmR analysis - Statistica Visual Basic - Statistica - Dell Community

svb for XmR analysis

svb for XmR analysis

This question is not answered

Hi.

I am trying to run XmR charts (aka Individual and Moving Range) on a datafile that has monthly data  for many (several thousand) individual products.  I tried using the "ByGroup" analysis, but I seemed to have found its upper limit of 2500 groups.  Therefore I'm trying to automate the analysis using svb.

Let me also admit that I'm not formally trained with Visual Basic.  I do program in 6+ languages, but - sadly - most of them are defunct.  I have been able to get by in the past with simple VB applications by adapting examples.

So far I have created a loop that seems to work reasonably well at iterating through the products (a test subset) and creating the XmR chart with some tailoring and labels.

What I would like to do is also capture indications, for each product, of special cause variation (outliers) and write this to a table so that I can use this to focus subsequent reviews to only products with interesting events (special cause variation).

I found the reference to "QuaShewhartChartResults.Outliers", which I understand gives an Object.  However, I find myself not knowing quite how to (1) write this to the workbook, and (2) evaluate its contents as either YES or NO for showing special cause variation.

Is this a forum where someone might be inclined to provide some guidance?

I'll apologize again for testing the patience of the proficient VB programmers with what is probably a basic question.

Thanks in advance.

Cliff

All Replies
  • Hi Cliff,

    The following snippet should help you achieve your goals - it generates the outliers spreadsheet, adds it to the workbook and saves the total number of outliers (<LCL and >UCL) in the X and MR charts in two variables.

    You should insert this code after you generate the X chart. Don't forget to replace oAD5 with your QuaShewhartChartResults object

        Set oStaDocs = oAD5.Outliers
        newanalysis.RouteOutput(oStaDocs).Visible = True

        xOutliers = oStaDocs(1).Value(3, 1)
        mrOutliers = oStaDocs(2).Value(3, 1)

        If xOutliers>0 Or mrOutliers>0 Then
            'special cause handling
        End If

    Hope this helps.

    Regards,
    Mário
     

  • Mario - many thanks! I'll give it a try.