home *** CD-ROM | disk | FTP | other *** search
/ Capture the Power of the Internet / Capture the Power of the Internet.iso / mac / MacFiles / System / Calculators / mathpad.sit / MathPad 2.5.2 / Examples / regression < prev    next >
MacBinary  |  1996-03-30  |  1.8 KB  |  [TEXT/MPad]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sat Mar 30 02:21:57 1996, modified Sat Mar 30 02:21:57 1996, creator 'MPad', type ASCII, 913 bytes "regression" , at 0x411 518 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPad]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 72 65 67 72 65 73 | 73 69 6f 6e 00 00 00 00 |..regres|sion....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 61 | 64 00 00 00 00 00 00 00 |.TEXTMPa|d.......|
|00000050| 00 00 00 00 00 03 91 00 | 00 02 06 ad 82 91 95 ad |........|........|
|00000060| 82 91 95 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 28 c0 00 00 |........|....(...|
|00000080| 2d 2d 20 22 6c 69 6e 65 | 61 72 20 72 65 67 72 65 |-- "line|ar regre|
|00000090| 73 73 69 6f 6e 22 20 66 | 69 74 20 78 2c 79 20 64 |ssion" f|it x,y d|
|000000a0| 61 74 61 20 74 6f 20 61 | 20 6c 69 6e 65 0d 2d 2d |ata to a| line.--|
|000000b0| 20 53 65 65 20 41 6c 73 | 6f 3a 20 58 46 75 6e 20 | See Als|o: XFun |
|000000c0| 22 6c 69 6e 66 69 74 22 | 0d 2d 2d 20 75 73 65 73 |"linfit"|.-- uses|
|000000d0| 20 3a 3d 20 74 6f 20 61 | 76 6f 69 64 20 72 65 2d | := to a|void re-|
|000000e0| 63 61 6c 63 75 6c 61 74 | 69 6e 67 20 73 75 6d 73 |calculat|ing sums|
|000000f0| 0d 73 75 6d 78 20 3a 3d | 20 73 75 6d 28 78 5b 69 |.sumx :=| sum(x[i|
|00000100| 5d 2c 69 2c 31 2c 6e 29 | 3a 0d 73 75 6d 78 78 3a |],i,1,n)|:.sumxx:|
|00000110| 3d 20 73 75 6d 28 78 5b | 69 5d 5e 32 2c 69 2c 31 |= sum(x[|i]^2,i,1|
|00000120| 2c 6e 29 3a 0d 73 75 6d | 79 20 3a 3d 20 73 75 6d |,n):.sum|y := sum|
|00000130| 28 79 5b 69 5d 2c 69 2c | 31 2c 6e 29 3a 0d 73 75 |(y[i],i,|1,n):.su|
|00000140| 6d 79 79 3a 3d 20 73 75 | 6d 28 79 5b 69 5d 5e 32 |myy:= su|m(y[i]^2|
|00000150| 2c 69 2c 31 2c 6e 29 3a | 0d 73 75 6d 78 79 3a 3d |,i,1,n):|.sumxy:=|
|00000160| 20 73 75 6d 28 78 5b 69 | 5d 2a 79 5b 69 5d 2c 69 | sum(x[i|]*y[i],i|
|00000170| 2c 31 2c 6e 29 3a 0d 0d | 53 78 78 3d 6e 2a 73 75 |,1,n):..|Sxx=n*su|
|00000180| 6d 78 78 2d 73 75 6d 78 | 5e 32 0d 53 78 79 3d 6e |mxx-sumx|^2.Sxy=n|
|00000190| 2a 73 75 6d 78 79 2d 73 | 75 6d 78 2a 73 75 6d 79 |*sumxy-s|umx*sumy|
|000001a0| 0d 0d 73 6c 6f 70 65 3d | 53 78 79 2f 53 78 78 0d |..slope=|Sxy/Sxx.|
|000001b0| 69 6e 74 65 72 63 65 70 | 74 3d 28 73 75 6d 78 78 |intercep|t=(sumxx|
|000001c0| 2a 73 75 6d 79 2d 73 75 | 6d 78 2a 73 75 6d 78 79 |*sumy-su|mx*sumxy|
|000001d0| 29 2f 28 6e 2a 73 75 6d | 78 78 2d 73 75 6d 78 5e |)/(n*sum|xx-sumx^|
|000001e0| 32 29 0d 63 6f 72 72 65 | 6c 61 74 69 6f 6e 3d 53 |2).corre|lation=S|
|000001f0| 78 79 2f 73 71 72 74 28 | 53 78 78 2a 28 6e 2a 73 |xy/sqrt(|Sxx*(n*s|
|00000200| 75 6d 79 79 2d 73 75 6d | 79 5e 32 29 29 0d 0d 2d |umyy-sum|y^2))..-|
|00000210| 2d 20 75 73 65 72 20 6d | 75 73 74 20 73 75 70 70 |- user m|ust supp|
|00000220| 6c 79 20 61 20 64 61 74 | 61 20 66 69 6c 65 20 6f |ly a dat|a file o|
|00000230| 66 20 78 20 79 20 76 61 | 6c 75 65 73 2e 0d 64 61 |f x y va|lues..da|
|00000240| 74 61 3d 72 65 61 64 28 | 22 78 79 64 61 74 61 22 |ta=read(|"xydata"|
|00000250| 29 0d 6e 3d 63 6f 75 6e | 74 28 64 61 74 61 29 20 |).n=coun|t(data) |
|00000260| 20 20 2d 2d 20 6e 75 6d | 62 65 72 20 6f 66 20 64 | -- num|ber of d|
|00000270| 61 74 61 20 70 6f 69 6e | 74 73 0d 0d 2d 2d 20 66 |ata poin|ts..-- f|
|00000280| 69 6c 65 20 69 73 20 6f | 72 67 61 6e 69 7a 65 64 |ile is o|rganized|
|00000290| 20 61 73 20 78 2c 79 20 | 70 61 69 72 73 2e 20 0d | as x,y |pairs. .|
|000002a0| 78 5b 69 5d 3d 64 61 74 | 61 5b 69 2c 31 5d 20 64 |x[i]=dat|a[i,1] d|
|000002b0| 69 6d 5b 6e 5d 20 2d 2d | 20 4d 61 6b 65 20 73 65 |im[n] --| Make se|
|000002c0| 70 20 78 20 61 6e 64 20 | 79 20 61 72 72 61 79 73 |p x and |y arrays|
|000002d0| 0d 79 5b 69 5d 3d 64 61 | 74 61 5b 69 2c 32 5d 20 |.y[i]=da|ta[i,2] |
|000002e0| 64 69 6d 5b 6e 5d 0d 0d | 70 6c 6f 74 20 64 61 74 |dim[n]..|plot dat|
|000002f0| 61 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |a | |
|00000300| 20 2d 2d 20 70 6c 6f 74 | 20 64 61 74 61 20 70 6f | -- plot| data po|
|00000310| 69 6e 74 73 0d 70 6c 6f | 74 20 58 2a 73 6c 6f 70 |ints.plo|t X*slop|
|00000320| 65 2b 69 6e 74 65 72 63 | 65 70 74 20 20 20 2d 2d |e+interc|ept --|
|00000330| 20 70 6c 6f 74 20 62 65 | 73 74 20 66 69 74 20 6c | plot be|st fit l|
|00000340| 69 6e 65 0d 0d 6c 61 62 | 65 6c 20 73 6c 6f 70 65 |ine..lab|el slope|
|00000350| 3a 30 2e 37 32 30 0d 6c | 61 62 65 6c 20 69 6e 74 |:0.720.l|abel int|
|00000360| 65 72 63 65 70 74 3a 2d | 31 2e 31 32 32 0d 6c 61 |ercept:-|1.122.la|
|00000370| 62 65 6c 20 63 6f 72 72 | 65 6c 61 74 69 6f 6e 3a |bel corr|elation:|
|00000380| 30 2e 39 37 33 0d 0d 2d | 2d 20 4e 6f 74 65 3a 20 |0.973..-|- Note: |
|00000390| 63 61 6e 20 61 6c 73 6f | 20 62 65 20 75 73 65 64 |can also| be used|
|000003a0| 20 74 6f 20 64 6f 20 32 | 20 70 61 72 61 6d 20 66 | to do 2| param f|
|000003b0| 69 74 20 66 6f 72 20 6f | 74 68 65 72 20 66 75 6e |it for o|ther fun|
|000003c0| 63 74 69 6f 6e 73 2e 0d | 7e 0d 20 66 28 78 29 20 |ctions..|~. f(x) |
|000003d0| 3d 20 2d 63 6f 73 28 78 | 29 0d 20 70 6c 6f 74 20 |= -cos(x|). plot |
|000003e0| 66 28 58 29 2a 73 6c 6f | 70 65 2b 69 6e 74 65 72 |f(X)*slo|pe+inter|
|000003f0| 63 65 70 74 0d 20 78 5b | 69 5d 3d 66 28 64 61 74 |cept. x[|i]=f(dat|
|00000400| 61 5b 69 2c 31 5d 29 20 | 64 69 6d 5b 6e 5d 0d 7e |a[i,1]) |dim[n].~|
|00000410| 0d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 94 | 00 00 00 94 00 00 00 72 |........|.......r|
|00000490| 80 0c 80 0c 80 0c 80 0c | 80 0c 80 0c 80 0c 80 0c |........|........|
|000004a0| 80 0c 80 0c 80 0c 80 0c | 80 0c 80 0c 80 0c 80 0c |........|........|
|000004b0| 0a 72 65 67 72 65 73 73 | 69 6f 6e 65 02 00 00 00 |.regress|ione....|
|000004c0| 54 45 58 54 4d 50 61 64 | 01 00 00 68 00 40 00 00 |TEXTMPad|...h.@..|
|000004d0| 00 00 54 45 58 54 4d 50 | 61 64 01 00 00 68 00 40 |..TEXTMP|ad...h.@|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 a7 d9 fb c2 00 00 | 03 91 00 00 02 06 80 9a |........|........|
|00000500| 80 9a 80 9a 80 9a 80 9a | 80 9a 00 9a 00 9e 00 a0 |........|........|
|00000510| 00 a2 00 a4 00 bc 80 ac | 00 ac 00 b0 00 ba 80 c6 |........|........|
|00000520| 00 c6 80 ca 00 ca 00 ce | 80 d4 00 d4 00 de 00 e8 |........|........|
|00000530| 80 ee 80 ee 80 ee 00 ee | 00 fc 81 04 81 04 81 04 |........|........|
|00000540| 81 04 81 04 81 04 81 04 | 81 04 01 04 81 08 01 08 |........|........|
|00000550| 01 0c 81 10 81 10 81 10 | 01 10 01 16 01 26 81 2e |........|.....&..|
|00000560| 01 2e 01 38 81 3c 01 3c | 81 40 01 40 01 46 81 4e |...8.<.<|.@.@.F.N|
|00000570| 01 4e 01 56 01 58 81 68 | 81 68 81 68 81 68 81 68 |.N.V.X.h|.h.h.h.h|
|00000580| 00 00 00 20 00 00 00 03 | 00 02 3f f9 8e fa 35 12 |... ....|..?...5.|
|00000590| 94 e9 c8 ae 01 41 01 2d | 00 04 00 27 00 b0 01 2b |.....A.-|...'...+|
|000005a0| 01 47 00 28 00 00 00 54 | 3e 7a 2e 8c 3f 6e df 8d |.G.(...T|>z..?n..|
|000005b0| 0c 81 00 0c 20 73 6c 6f | 70 65 3a 30 2e 37 32 30 |.... slo|pe:0.720|
|000005c0| 3e 6e 8b a3 3f 63 27 a9 | 11 81 00 12 20 69 6e 74 |>n..?c'.|.... int|
|000005d0| 65 72 63 65 70 74 3a 2d | 31 2e 31 32 32 00 3e 74 |ercept:-|1.122.>t|
|000005e0| 5d 17 3f 57 6f c6 12 81 | 00 12 20 63 6f 72 72 65 |].?Wo...|.. corre|
|000005f0| 6c 61 74 69 6f 6e 3a 30 | 2e 39 37 33 00 00 00 14 |lation:0|.973....|
|00000600| 00 00 06 4d 6f 6e 61 63 | 6f 01 39 06 4d 6f 6e 61 |...Monac|o.9.Mona|
|00000610| 63 6f 01 39 00 00 01 00 | 00 00 01 94 00 00 00 94 |co.9....|........|
|00000620| 00 00 00 72 00 66 e9 58 | 0c 20 00 00 00 1c 00 5a |...r.f.X|. .....Z|
|00000630| 00 02 50 52 65 66 00 00 | 00 1a 4c 42 4c 53 00 00 |..PRef..|..LBLS..|
|00000640| 00 26 53 54 52 23 00 00 | 00 32 00 80 ff ff 00 00 |.&STR#..|.2......|
|00000650| 00 00 00 66 e8 c8 00 80 | 00 00 00 00 00 24 00 00 |...f....|.....$..|
|00000660| 00 00 00 81 00 0c 00 00 | 00 7c 00 66 e8 a4 0b 70 |........|.|.f...p|
|00000670| 6c 6f 74 20 6c 61 62 65 | 6c 73 0b 66 6f 6e 74 20 |lot labe|ls.font |
|00000680| 26 20 73 69 7a 65 00 00 | 00 00 00 00 00 00 00 00 |& size..|........|
|00000690| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+