Дж. С. Дэвис. Статистический анализ данных в геологии. Книга 2
CALL PAUSE(2)
RETURN
2000 FORMAT (///,' Source of',14X,'Sum of Degrees of Mean',/
1' Variation',13X,'Squares Freedom Squares F-Tests',/,
21X,60(1H-))
2001 FORMAT (14H Among Samples,7X,F10.2,18,2X.F10.3,',
141X,F20.4)
2005 FORMAT (14H Among Samples,7X,E10.3,I8,2X,E10.3,/,
141X,F20.4)
2002 FORMAT (17H Among Treatments,4X,F10.2,I8,2X,F10.3,/,41X,F20.4)
2006 FORMAT (17H Among Treatments,4X,E10.3,l8,2X,E10.3,/,41X,F20.4)
2003 FORMAT (6H Error,15X,F10.2,l8,2X,F10.3)
2007 FORMAT (6H Error,15X.E10.3,I3,2X,E10.3)
2004 FORMAT (/,16H Total Variation,5X,F10.2,l8)
2008 FORMAT (/,16H Total Variation,5X,E10.3,l8)
END
C
CLINFIT LINFIT - PROGRAM 5-3
C
C ROUTINE LINFIT
C
C PROGRAM TO FIT A UNEAR REGRESSION.
C
C ARRAY A CONTAINS X AND Y DATA THAT IS READ IN.
C ARRAY B CONTAINS THE COEFFICIENTS OF THE UNKNOWN B'S IN THE
C NORMAL EQUATIONS 5.7 AND 5.8.
C ARRAY C ORIGINALLY IS A VECTOR THAT CONTAINS THE SUM OF THE Y'S
C AND THE SUMS OF THE CROSSPRODUCTS OF X AND Y IN EQUATION 5.11
C AFTER THE NORMAL EQUATIONS ARE SOLVED, ARRAY C CONTAINS THE
C COEFFICIENTS OF THE REGRESSION EQUATION.
C SUMS OF THE CROSSPRODUCTS OF X AND Y IN EQUATION 5.11.
C ARRAY D CONTAINS X, Y, Y-CALCULATED. AND DEVIATIONS FOR ALL
C DATA POINTS.
C
C THE MAXIMUM NUMBER OF OBSERVATIONS IS 100.
C
C SUBROUTINES NEEDED ARE READM, PRINTM, AND SLE.
C
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C
SUBROUTINE UNFIT
COMMON /TLC/ SV(20),LZ,LU,Z11,Z22,D11,D22,N22,NSP,DPC,DFT,UPA
COMMON /IOLUN/ l5,l6,J5,J6,J4
COMMON /IONAT/ KORF,MON,IPRT,KORF0
CHARACTER*1 KORF,MON,IPRT,KORF0
COMMON /DATQ/ A(100,2),B(2,2),C(2),D(100,4)
C
NMAX = 100
WRITE(I6,200)
200 FORMAT(/' LINEAR REGRESSION MODULE'//)
C
C READ X-Y DATA
C
IF(KORF.EQ.'K') WRITE(16,201)
201 FORMAT(/' Enter number of observed pairs: ')
READ(JS,*,.END=500 N,NCOL
IF(N.LE.1.OR.NCOL.NE.2) GOTO 501
IF(N.LE.NMAX) GOTO 105
WRITE(I6,202) NMAX
202 FORMAT(/' Number of observed pairs exceed max of ',14)
LZ = -9
CALL PAUSE(2)
RETURN
105 DO 106 I = 1,N
IF(KORF.EQ.'K') WRITE(I6,203) I