Re: [R] Help with Sequential Differencing

2012-06-19 Thread Lekgatlhamang, lexi Setlhare
stand much better. I will turn to testing the second code. Cheers. Lexi   - Original Message - From: Sarah Goslee To: "Lekgatlhamang, lexi Setlhare" Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 3:58 PM Subject: Re: [R] Help with Sequential Differencing I m

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
xi From: Sarah Goslee Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 12:54 PM Subject: Re: [R] Help with Sequential Differencing If you really want DCred1, DCred2, etc, you'll need to use assign() and paste() within your loop. But h

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Thanks Sarah,   Yes, I really want DCred1, DCred2, etc. I will check and understand your answer. I appreciate your time and help.   Lexi From: Sarah Goslee Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 12:54 PM Subject: Re: [R] Help with

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
.frame.default(formula = DCred ~ DCred[[1]], > drop.unused.levels = TRUE) : >   variable lengths differ (found for 'DCred[[1]]') > > I will remain reading up on the assign and paste commands. > Thanks. Lexi > From: Sarah Goslee > To: "Lekgatlhamang, lexi Setlhar

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Sarah Goslee
[[1]], > drop.unused.levels = TRUE) : >   variable lengths differ (found for 'DCred[[1]]') > > I will remain reading up on the assign and paste commands. > Thanks. Lexi > From: Sarah Goslee > To: "Lekgatlhamang, lexi Setlhare" > Cc: "r-help@r-proj

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Sarah Goslee
If you really want DCred1, DCred2, etc, you'll need to use assign() and paste() within your loop. But he's a more R-ish way: # Differences of Cred DCred <- list() for(i in 1:5){ print(DCred[[i]]<- diff(DCred, lag=i, difference=1)) } DCred[[1]] Sarah On Friday, June 15, 2012, Lekgatlhamang, le

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Dear R Users, Sorry for what seems like I am re-posting. When I was typing my initial posting, I intended to copy and paste the commands from my script, but ended up forgetting. I am now pasting the commands in this email.NB: Below is a copy of 'all' the relevant commands in my script    ###

[R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Dear R Users, I have struggled with the following problem for days, which I thought was simple, although it would likely be basic to most of you. I am working with time series data. In my script, my intention is to create first differences of the variables in the file so that I end up estimat