Skip to content

random permuted block randomization

6 messages · Ayesha Khan, Ayesha, Greg Snow

#
Take a look at the blockrand package, it may do what you want.
hope this helps,
#
Sorry, that is a stupid bug in the blockrand function.  I will hunt down the author and slap him upside the head until he fixes it (actually I will probably just raid his freezer and eat his ice cream).

In the mean time there is a simple work around, if you run blockrand like:
Then it will force all the block sizes to be 8.

Look for a new version of blockrand on CRAN soon with this fixed.
#
oki :D 

and do you know if there is an inbuilt R pacakage that calculate moving
averages  over time?
i found this , 
"Calculate various moving averages (MA) of a series."
Usage

  SMA(x, n=10)
  EMA(x, n=10, wilder=FALSE)

but when i tried SMA , R wouldnt recognize it! and there isnt such a package
as SMA in the install packages list either.
#
you might want to look at the rollmean function in the zoo package if you want a fixed window.  If you want a cumulative mean then you can do something like
If neither of those work, then give us some more detail.