/* nag_rank_ci_1var (g07eac) Example Program. * * Copyright 2001 Numerical Algorithms Group. * * Mark 7, 2001. */ #include #include #include #include int main(void) { /* Scalars */ double clevel, estcl, theta, thetal, thetau, wlower, wupper; Integer exit_status, i, n; NagError fail; /* Arrays */ double *x=0; INIT_FAIL(fail); exit_status = 0; Vprintf("g07eac Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n] "); Vscanf("%ld%*[^\n] ", &n); /* Allocate memory */ if ( !(x = NAG_ALLOC(n, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } for (i = 1; i <= n; ++i) Vscanf("%lf", &x[i - 1]); Vscanf("%*[^\n] "); Vscanf("%lf%*[^\n] ", &clevel); g07eac(Nag_RCI_Exact, n, x, clevel, &theta, &thetal, &thetau, &estcl, &wlower, &wupper, &fail); if (fail.code != NE_NOERROR) { Vprintf("Error from g07eac.\n%s\n", fail.message); exit_status = 1; goto END; } Vprintf("\n"); Vprintf(" Location estimator Confidence Interval\n"); Vprintf("\n"); Vprintf("%10.4f ( %6.4f , %6.4f )\n", theta, thetal, thetau); Vprintf("\n"); Vprintf(" Corresponding Wilcoxon statistics\n"); Vprintf("\n"); Vprintf(" Lower : %8.2f\n", wlower); Vprintf(" Upper : %8.2f\n", wupper); END: if (x) NAG_FREE(x); return exit_status; }