Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statistical Analysis

Status
Not open for further replies.

crewchiefpro5

Programmer
Dec 17, 2004
33
US
Does anyone have any statistical analysis examples other than standard deviation, average, variance. For example, how Loglinear regression, logistic regression etc.

The standard statistical stuff in foxpro is fine for simple stuff but I am having some difficulty translating formulas into it.

Don Higgins
Crew Chief Pro Drag Racing Software
 
Below is an example of linear regression I've worked up. It uses non -999 values and projects additional values.

Brian

Code:
CREATE TABLE lin_reg_test (callgroup c(10),triggeramt n(10))

FOR x = 1 TO 15
ALTER TABLE DBF() ADD COLUMN ([cpr]+TRANSFORM(x)) n(20,5)
ENDFOR

INSERT INTO lin_reg_test VALUES ([lin test],0,;
	4862,5244,5128,5052,5298,5410,5234,5608,-999,-999,-999,-999,-999,-999,-999)

SCAN
	lnSSx=0 &&counter is our X value
	lnSSxy=0
	lnAvgX=0
	lnAvgY=0
    lnTestVal=0

	lnCprCnt=1
	DO WHILE EVALUATE([cpr]+TRANSFORM(lnCprCnt))#-999 AND lnCprCnt<FCOUNT()-2&&pass 1 to make Averages
	    lnAvgX=lnAvgX+lnCprCnt
	    lnAvgY=lnAvgY+EVALUATE([cpr]+TRANSFORM(lnCprCnt))
	    lnCprCnt=lnCprCnt+1
	 ENDDO
	 	lnAvgX=lnAvgX/(lnCprCnt-1)
	 	lnAvgY=lnAvgY/(lnCprCnt-1)

    lnCprCnt=1
	DO WHILE EVALUATE([cpr]+TRANSFORM(lnCprCnt))#-999 AND lnCprCnt<FCOUNT()-2&&pass 2 to make Sum of Squares
	    lnSSx=lnSSx+(lnCprCnt-lnAvgX)^2
	    lnSSxy=lnSSxy+(lnCprCnt-lnAvgX)*(EVALUATE([cpr]+TRANSFORM(lnCprCnt))-lnAvgY)
	    lnCprCnt=lnCprCnt+1
	 ENDDO

	lnB = lnSSxy/lnSSx
	lnA = lnAvgY-lnB*lnAvgX
	
	DO WHILE lnCprCnt<FCOUNT()-1
	     REPLACE ([cpr]+TRANSFORM(lnCprCnt)) WITH lnA+lnB*lnCprCnt
 	 	 lnCprCnt=lnCprCnt+1
	ENDDO	  
ENDSCAN
 
Geoff,

Speed and record limitations in Excel makes automating it less than perfect solution. I do use Excel's stat functions to test my results though :)

Brian
 
baltman,
Thanks, I will try your program.

Geoff,
I did not want to use the excel automation because many customers of mine don't have excel. I need some specific functions that I am sure are in excel but this causes the price of the software to skyrocket.

Drag Racers have a bunch of money, but they seem stingy when I tell them they need an additional program to do what they want.

Don Higgins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top