> #test probability distributions, stats, and macros
> .Random.seed <- c(57,0,3,0,0,0,49,16,0,0,0,0)
> mac.testdist <- list(.Data=
+ 	"print(mean(?(p)$1(?(q)$1(ppoints($2),$*),$*)-ppoints($2)))",
+ 	args=c("dist","n"),deflt=c("","100"))
> mprint(mac.testdist)
Error: couldn't find function "mprint"
> macro("?LOOP(?testdist($%1,200),norm,logis,sep=;)")
> print(mean(pnorm(qnorm(ppoints(200),  ),  ) - ppoints(200)))
[1] 5.91157e-09
> print(mean(plogis(qlogis(ppoints(200),  ),  ) - ppoints(200)))
[1] -1.585577e-09
> macro(Continue string: "?LOOP(?testdist($%1,100,2)\n,norm,logis,t,chisq,gamma,sep=)")
> print(mean(pnorm(qnorm(ppoints(100), 2), 2) - ppoints(100)))
[1] 1.722947e-08
> print(mean(plogis(qlogis(ppoints(100), 2), 2) - ppoints(100)))
[1] -1.466833e-09
> print(mean(pt(qt(ppoints(100), 2), 2) - ppoints(100)))
[1] 7.650815e-09
> print(mean(pchisq(qchisq(ppoints(100), 2), 2) - ppoints(100)))
[1] -5.685724e-09
> print(mean(pgamma(qgamma(ppoints(100), 2), 2) - ppoints(100)))
[1] -4.870817e-09
> old.seed_.Random.seed;
> stem(rnorm(100))

N = 100   Median = -0.060296
Quartiles = -0.6370286, 0.716779

Decimal point is at the colon

  -3 : 0
  -2 :
  -2 : 20
  -1 : 966
  -1 : 4444322000
  -0 : 98887777666655
  -0 : 4444433222222111111110000
   0 : 0022333333444
   0 : 5556667789999
   1 : 001111223
   1 : 5668
   2 : 000123

> .Random.seed_old.seed;
> stem(rnorm(100))	#should be the same

N = 100   Median = -0.060296
Quartiles = -0.6370286, 0.716779

Decimal point is at the colon

  -3 : 0
  -2 :
  -2 : 20
  -1 : 966
  -1 : 4444322000
  -0 : 98887777666655
  -0 : 4444433222222111111110000
   0 : 0022333333444
   0 : 5556667789999
   1 : 001111223
   1 : 5668
   2 : 000123

> stem(c(runif(75),NA,80))	# an outlier and an NA
Contained 1 NAs

N = 76   Median = 0.537241
Quartiles = 0.224636, 0.818826

Decimal point is 1 place to the left of the colon

   0 : 224567779
   1 : 012467789
   2 : 23569
   3 : 0119
   4 : 034555789
   5 : 3344489
   6 : 3479
   7 : 01133468
   8 : 012346779
   9 : 0012246789
  10 : 0

High:  80

> var(rnorm(1000));
[1] 0.9919163
> var(rnorm(1000),trim=.1)
Error: Argument trim not matched: var(rnorm(1000), trim = 0.1)
> #sink("tttt")
> #mprint(list=ls("mac.*",pos=2))	# print all macros to file
> #sink(); sys("tail tttt")	# print a few lines
> #!rm tttt
> mean(rnorm(100));
[1] 0.01309105
> mean(rnorm(100),trim=.1
+ )	# continuation
[1] 0.03838649
> mean(zzqq_rnorm(100),trim=.5)==median(zzqq)
[1] T
> # try to use the medit command after fixing up this
> # coming syntax error with EDIT
> Syntax error: "," used illegally at line 3 of standard input
"change the comma in the middle",> "to a semi-colon"
[1] "to a semi-colon"
> # this should never be executed since a syntax error preceeds it!!
> 
> 4.5u 2.5s 21r 	 /usr/s/cmd/Sqpe
