[S] Creating first difference object

Thomas J. Downing (t_downing@yahoo.com)
Fri, 6 Mar 1998 13:46:58 -0800 (PST)


Dear List:

I am a relatively new user to S-PLUS and there is probably a
simple answer to this, but my current problem is: Given an n x k
matrix A, I would like to create an (n-1) x k matrix B where each
element B n,k = A n+1,k - A n,k (see below)

Given data frame A : desired object B :

100 100 100 100
103 102 98 103 3 2 -2 3
100 104 95 100 -3 2 -3 -3
100 106 96 102 0 2 1 2
97 109 96 102 -3 3 0 0
99 111 96 101 2 2 0 -1
98 113 93 98 -1 2 -3 -3
98 111 90 96 0 -2 -3 -2

Any help with this problem is greatly appreciated.
==
Thomas J. Downing
Research Assistant
Quantitative Research
Value Line, Inc.

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news