View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default Using Regression Function in VBA Macro

ok, for REGRESS macro

REGRESS(inpyrng, inpxrng, constant, labels, confid, soutrng, residuals,
sresiduals, rplots, lplots, routrng, nplots, poutrng)


Inpyrng is the input range for the y-values (dependent variable).

Inpxrng is the input range for the x-values (independent variable).

Constant is a logical value. If constant is TRUE, the y-intercept is
assumed to be zero (the regression line passes through the origin). If
constant is FALSE or omitted, the y-intercept is assumed to be a non-zero
number.

Labels is a logical value.
If labels is TRUE, then the first row or column of the input ranges contain
labels.
If labels is FALSE or omitted, all cells in inpyrng and inpxrng are
considered data. Microsoft Excel will then generate the appropriate data
labels for the output table.

Confid is an additional confidence level to apply to the regression. If
omitted, confid is 95%.

Soutrng is the first cell (the upper-left cell) in the output table or
the name, as text, of the new sheet to contain the summary output table. If
FALSE, blank, or omitted, places the summary output table in a new workbook.

Residuals is a logical value. If residuals is TRUE, REGRESS includes
residuals in the output table. If residuals is FALSE or omitted, residuals
are not included.

Sresiduals is a logical value. If sresiduals is TRUE, REGRESS includes
standardized residuals in the output table. If sresiduals is FALSE or
omitted, standardized residuals are not included.

Rplots is a logical value. If rplots is TRUE, REGRESS generates separate
charts for each x versus the residual. If rplots is FALSE or omitted,
separate charts are not generated.

Lplots is a logical value. If lplots is TRUE, REGRESS generates a chart
showing the regression line fitted to the observed values. If lplots is
FALSE or omitted, the chart is not generated.

Routrng is the first cell (the upper-left cell) in the residuals output
table or the name, as text, of the new sheet to contain the residuals output
table. If FALSE, blank, or omitted, places the residuals output table in a
new worksheet. This argument is for compatibility with Microsoft Excel 4.0
and is ignored in Microsoft Excel version 5.0.

Nplots is a logical value. If nplots is TRUE, REGRESS generates a chart
of normal probabilities. If nplots is FALSE or omitted, the chart is not
generated.

Poutrng is the first cell (the upper-left cell) in the probability data
output table or the name, as text, of the new sheet to contain the
probability output table. If FALSE, blank, or omitted, places the
probability output table in a new worksheet.

isabelle

Le 2014-05-27 12:55, Peter T a écrit :

Indeed the tool uses LinEst but can get more stats like this

x = Application.LinEst(Range("A2:A5"), Range("B2:B5"), True, True)

Returns a 5x2 array of stats as shown on the help page you referred to.

The regression tool returns other stats that LinEst doesn't, though LinEst
can also return the polyniomial cooefficients of a 'best fit' curved line.

Regards,
Peter T