STATISTICA







Calling STATISTICA from within Visual Basic

Example: This example uses the Shell function to run an SCL program specified by the user. The SCL program will perform a simple correlation and regression analysis.


Visual Basic Code

Private Sub Command1_Click()
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
' Run Sample.scl.
RetVal = Shell("c:\stat\sta_run.exe c:\stat\examples\sample.scl", 1)
End Sub
STATISTICA Command Language Code

FILE = 'c:\stat\examples\exp.sta'	{select a data file ("exp.sta")}

OUTPUTSETUP		{select output options for Scrollsheets and graphs}
	REPORTFILE = 'c:\stat\examples\report.rtf'	{save the output report to this report file}
	SCROLLSHEETS = WINDOW	{append all Scrollsheets to the report window}
	GRAPHS = WINDOW		{append all graphs to the report window}

CORR				{compute a detailed correlation matrix}
	VARS = ALL
	/DETAILED
	STATS = ALL

REGR				{perform a multiple regression}
	DEP = STRESS_R
	INDEP = CORRECT1 CORRECT2
	/INTERCEPT = NO
	STATS = ALL

STOP
Back to List of Programs


[StatSoft]
2300 East 14th Street, Tulsa, OK 74104
Phone: (918) 749-1119; Fax: (918) 749-2217

[StatSoft]e-mail: info@statsoft.com

©Copyright StatSoft, Inc., 1984-2005.
StatSoft, StatSoft logo, STATISTICA, SEWSS, SEDAS, Data Miner, SEPATH and GTrees are trademarks of StatSoft, Inc.