Hi,
I tried to simulate an ARIMA model by using arima.sim(), say
arima.sim(n=100,list(order=c(1,0,1),ar=0.6,ma=0.9,sd=1), but the acf and pacf
of simulated data using acf() and pacf() are so much different from the
theoritcal acf and pacf. For instance, in my case, ar=0.6 and ma=0.9, so the
ac
Hi:
I have usually used the GROWTH() excel function to do this but now want to see
if I can do this with R.
I want to predict values into the future, possibly with the predict.arima
Function.
I have the following weekly fish weight averages:
weight <- c("2.1","2.4","2.8","3.6","4.1","5.2","6.3
Here is what I get from using 'fitdistr' in R to fit to a lognormal.
The resulting density plot from the distribution seems to be a reason
match to the data.
> x <- scan()
1: 0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559
9: 0.85009 0.85804 0.73324 1.04826 0.84002
14: 1.76330 0.71
G'day Dirk,
On Sat, 4 Apr 2009 20:27:22 -0500
Dirk Eddelbuettel wrote:
> On 4 April 2009 at 14:37, Ken-JP wrote:
> > Yes, I have x11-common installed, and dpkg -S /etc/X11/rgb.txt
> > shows "not found" for me. This is on Ubuntu 8.10 amd64.
>
> Same 8.10 for both amd64 and i386 where I checked
Hi,
I'm relatively new to R and it'll be great if someone can help me with what
I'm doing here.
I am trying to do multiple imputation on my dataset, but I'm not quite sure
which function to use as my dataset contains dichotomous variables.
Here's an outline of what i've done so far, and i'm not
For equally spaced observations this is quite simple and available in
various packages
but I like Gabor Grothendieck's version (which didn't come up
immediately in my Rseek search:
hpfilter <- function(y,lambda=1600)
eye <- diag(length(y))
solve(eye+lambda*crossprod(diff(eye,d=2)),y)}
ur
Dear ALL
I have a list of data below
0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559
0.85009 0.85804 0.73324 1.04826 0.84002
1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549
0.93641 0.80418 0.95285 0.76876 0.82588
1.09394 1.00195 1.14976 0.80008 1.11947 1.09484 0.8149
Hi again,
On 4 April 2009 at 14:37, Ken-JP wrote:
| Yes, I have x11-common installed, and dpkg -S /etc/X11/rgb.txt shows "not
| found" for me.
| This is on Ubuntu 8.10 amd64.
Same 8.10 for both amd64 and i386 where I checked -- both have the file. It
could be a leftover from an earlier install
On 04/04/2009 6:34 PM, mackas21 wrote:
Hi,
I'm having a problem using sample() within a function.
Basically I get an error reading:
Error in sample(v, 1, prob = h) : non-positive probability
Can anyone advise me as to the possible origin of this error?
Presumably h doesn't contain a vector o
Hi: you've got to create a setdiff in both directions in order to get the
lone ones in each column because setdiff is
not commutative meaning that setdiff(a,b) does not equal setdiff(b,a). once
you do that, then
( setdiff1 + setdiff2 - intersect ) should equal the union.
if it
Hi,
I'm having a problem using sample() within a function.
Basically I get an error reading:
Error in sample(v, 1, prob = h) : non-positive probability
Can anyone advise me as to the possible origin of this error?
Here is my code
#Discretised Gillespie algorithm function (From SMfSB, D.J. Wilk
hello,
I am hoping for some advice regarding comparing variables from 3
versions of a spreadsheet which have been combined into a single
dataframe. The aim is to identify which rows have been changed.
The dataframe contains 177 rows of data (each cell contains text).
'intersect' produced a f
Sorry for posting this twice, but I still have not solved this problem
and am hoping for some assistance.
I am attempting to write a function that is flexible enough to respond
to the user providing a formula (with a data= argument) or not (similar
to plot(x,y) versus plot(y~x,data=data)). I h
On Apr 4, 2009, at 3:42 PM, AllenL wrote:
Searched for "by" in forums and no hits, should be simple problem.
The help page for by must surely have have *some* information?
This is my line:
bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd))
I want to calculate the mean of "AbvBio
On 04/04/2009 5:13 PM, Umesh Srinivasan wrote:
Hi,
Is there a way to use par to change the colours of the axes lines (not the
labels)? I've done this:
par(bg = "black")
plot(x, y, col = "yellow", pch = 16)
but I have to use
axes = F within the plot command, and then use
axis (1, col = "yello
WilDsc0p wrote:
Dear List,
I typed
page(survival:::print.coxph, "print" )
and I got the respective codes.
page(MASS::lda, "print")
gives me
###
function (x, ...)
UseMethod("lda")
###
Is there any way I can get/extract the lda fu
Melissa2k9 wrote:
Uwe Ligges-3 wrote:
Melissa2k9 wrote:
Hi,
I have written a for loop as such:
model<-lm(Normalised~Frame,data=All,subset=((Subject==1)&(Filmclip=="Strand")))
summary(model)
###
#To extract just the Adjusted R squared
Umesh Srinivasan wrote:
Hi,
Is there a way to use par to change the colours of the axes lines (not the
labels)? I've done this:
par(bg = "black")
plot(x, y, col = "yellow", pch = 16)
but I have to use
axes = F within the plot command, and then use
axis (1, col = "yellow")
axis (2, col = "y
AllenL wrote:
Searched for "by" in forums and no hits, should be simple problem.
This is my line:
bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd))
I want to calculate the mean of "AbvBioAnnProd" in each Plot. What am I
doing wrong?
What is AbvBioAnnProd? I only see that you pass D
Yes, I have x11-common installed, and dpkg -S /etc/X11/rgb.txt shows "not
found" for me.
This is on Ubuntu 8.10 amd64.
http://ubuntuforums.org/archive/index.php/t-59024.html
Thanks for the detailed explanation on how R decides on where to install
packages!
I think I ran into problems when I ha
Dear List,
I typed
> page(survival:::print.coxph, "print" )
and I got the respective codes.
> page(MASS::lda, "print")
gives me
###
function (x, ...)
UseMethod("lda")
###
Is there any way I can get/extract the lda function from MASS?
T
On 4 April 2009 at 13:59, Ken-JP wrote:
| An update: after several days of struggling, I got StatET to work on Ubuntu
| 8.10 amd64, R 2.8.1.
|
| Here are some tips:
| 1. You may run into an X11 issue with tktcl in R as someone decided to omit
| /etc/X11/rgb.txt If you get weird issues with your
Hi,
Is there a way to use par to change the colours of the axes lines (not the
labels)? I've done this:
par(bg = "black")
plot(x, y, col = "yellow", pch = 16)
but I have to use
axes = F within the plot command, and then use
axis (1, col = "yellow")
axis (2, col = "yellow")
and so on for axes
An update: after several days of struggling, I got StatET to work on Ubuntu
8.10 amd64, R 2.8.1.
Here are some tips:
1. You may run into an X11 issue with tktcl in R as someone decided to omit
/etc/X11/rgb.txt If you get weird issues with your R installation with
window colors like "red" or "bla
Ahhh - so simple, my mistake. Thanks!
Murray
José Manuel Blanco Moreno wrote:
Hello,
The problem is that your first three points CANNOT be collinear. This
is a feature of trmesh in tripack. So: either you "unsort" your data
(keeping the indices you can sort them again) or alter (e.g. jitter)
Searched for "by" in forums and no hits, should be simple problem.
This is my line:
>bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd))
I want to calculate the mean of "AbvBioAnnProd" in each Plot. What am I
doing wrong?
Thanks in advance,
-AL
--
View this message in context:
http://ww
Try this:
library(zoo)
library(lattice)
z <- as.zoo(EuStockMarkets)
xyplot(z) # original
xyplot(z, type = "smooth") # smooth
In zoo see ?xyplot.zoo and in lattice see ?panel.xyplot
On Sat, Apr 4, 2009 at 3:19 PM, Rob Denniker wrote:
> Can someone please show me how to smooth time series data t
Can someone please show me how to smooth time series data that I have in the
form of a zoo object?
I have a monthly economies series and all I really need is to see a less jagged
line when I plot it.
If I do something like
s <- smooth.spline(d.zoo$Y, spar = 0.2)
plot(predict(s,index(d.zoo)),
On Sat, Apr 4, 2009 at 12:28 PM, jim holtman wrote:
> Does this do what you want:
>
>> x <- read.table(textConnection("name wrist nLevel emot
> + 1 4094 3.34 1 frustrated
> + 2 4094 3.94
An alternative to Jim's route might be to create
functions rather than relying entirely on scripts.
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")
jim holtman wrote:
Create a "master" file that
Does this do what you want:
> x <- read.table(textConnection("name wrist nLevelemot
+ 14094 3.341 frustrated
+ 24094 3.941 frustrated
+ 34094NA
On Sat, Apr 4, 2009 at 12:09 PM, ds wrote:
>
> I have a data frame something like:
> name wrist
> nLevel emot
> 1 4094 3.34 1
> frustrated
> 2 4094 3.94 1
> frustra
I have a data frame something like:
name wrist
nLevelemot
14094 3.341
frustrated
24094 3.941
frustrated
3409
Create a "master" file that 'source's the required *.R files and then
does any of the pre/post processing that you want.
On Fri, Apr 3, 2009 at 4:30 PM, wrote:
> I already searched for information regarding the batch file operations
> within R. But I could not locate the information I need.
>
>
> Gabor Grothendieck writes:
> Here is a minor variation:
> par <- function( ... ) structure( graphics::par( ... ), class = "par" )
> with.par <- function( data, expr, ... ) {
>on.exit(par(old.par, no.readonly = TRUE))
>old.par <- data
>invisible(expr)
> }
> which returns expr in
Here's a simplified version of some code I wrote for a demonstration. I
wanted a function that was attached to a tck/tk button to redo a
simulation on request; then some plots were changed, etc. But it didn't
work on the first attempt:
> x <- NULL
> xmean <- NULL
>
> resim <- function() {
+
Hesen Peng wrote:
>
>
> Thanks a lot for reminding me of this. The original code is too
> complicated and stems from several other objects. So I guess this
> simplified code may help:
>
> a <- rnorm(100)
> class(a) <- "foo"
>
> plot.foo <- function(data){
> ## opar<-par()
> par(mfcol=c(1,
To get what you want with the basic graphics, you probably want
something like this (tuned to you data):
a <- rnorm(100)
class(a) <- "foo"
plot.foo <- function(data){
## opar<-par()
#-- par(mfcol=c(1,2))
hist(data)
boxplot(data)
## par(mfcol=c(1,1))
}
par(mfcol=c(4,2))
plot(a)
plot(a)
plot
Hi,
Thanks a lot for reminding me of this. The original code is too
complicated and stems from several other objects. So I guess this
simplified code may help:
a <- rnorm(100)
class(a) <- "foo"
plot.foo <- function(data){
## opar<-par()
par(mfcol=c(1,2))
hist(data)
boxplot(data)
## par(m
Here is a minor variation:
par <- function( ... ) structure( graphics::par( ... ), class = "par" )
with.par <- function( data, expr, ... ) {
on.exit(par(old.par, no.readonly = TRUE))
old.par <- data
invisible(expr)
}
which returns expr invisibly so that this works:
bp <- with(par(mar =
> Romain Francois writes:
> "with" is generic, so you could do something like that:
>> par <- function( ... ) structure( graphics::par( ... ), class = "par" )
>> with.par <- function( data, expr, ... ){
> +old.par <- data
> +expr
> +invisible( par( old.par ) )
> + }
>> with( par(
Just in case you are still interested in theoretical aspects:
In combinatorial optimization, the problem you describe is known as the
Quadratic (Sum) Assignment Problem (QAP or QSAP) and is well known to
arise in facility and warehouse layouts. The task itself is considered
hard, comparable to th
Are the different systems using the same version of the zoo package?
On Fri, Apr 3, 2009 at 2:49 PM, Scott Tennican wrote:
>
> Hi Gabor,
>
> It seems that the problem depends on operating system.
> I have recently switched from using R on Windows Vista to using it on Ubuntu
> Linux.
> I had alrea
> Romain Francois writes:
> Jim Ottaway wrote:
>> Is there some sort of 'with.par' function that temporarily changes par
>> parameters and then re-sets them so that instead of doing things such as
> "with" is generic, so you could do something like that:
>> par <- function( ... ) structure(
Hello,
The problem is that your first three points CANNOT be collinear. This is
a feature of trmesh in tripack. So: either you "unsort" your data
(keeping the indices you can sort them again) or alter (e.g. jitter) the
coordinates very slightly. Either solution will do the work.
Cheers,
José M
> Of all the dangerous ways of doing this and getting confusing results,
> gl1ce in lasso2 should be the least risky.
Thanks Dieter. In case an exhaustive search (all subsets) remains
infeasible, I'll include a shrinkage method for sure. Looks like
glmpath could be useful here.
Best,
Harald
___
Jim Ottaway wrote:
Is there some sort of 'with.par' function that temporarily changes par
parameters and then re-sets them so that instead of doing things such as
opar <- par(mar=c(4.1,4.1,4.1,8),...)
par(opar)
you can do something like
with.par(mar=c(4.1,4.1,4.1,8),...,
)
where all
Is there some sort of 'with.par' function that temporarily changes par
parameters and then re-sets them so that instead of doing things such as
opar <- par(mar=c(4.1,4.1,4.1,8),...)
par(opar)
you can do something like
with.par(mar=c(4.1,4.1,4.1,8),...,
)
where all but the last argument
You can find a discussion of subscripting
in pretty much any document on R.
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")
onyourmark wrote:
Yes, That is it!
Can I just make sure I understand i
Yes, That is it!
Can I just make sure I understand it?
the second entry in perm[ , ] indicates the column, but you are putting in a
vector. This will therefore give a vector?? (any suggestions under what
topic I can read about this?)
So it is like a loop and each time it is filling in the next ent
All,
There are still places available on the following courses. For more detailed
information and a registration form please contact
train...@mango-solutions.com, or visit our website at www.mango-solutions.com.
The R Language
Dates: 21st t
WOW. Is it really that compact? I will give it a try. Amazing if true.
Thanks.
Patrick Burns wrote:
>
> You need a comma (,) not a dot (.) in your
> subscripting of the matrix. If I get the question
> correctly, you want:
>
> newTS2 <- perm[100, TS2]
>
>
> Patrick Burns
> patr...@burns-stat.
Bugzilla from rmh3...@gmail.com wrote:
>
> I have an anova model that looks like this:
>
> aov(log(Y)~X+Error(Participant/X))
>
> Is there a way to do a planned contrast on a repeated measures
> model... something with an error term? I get an error when I do this:
> contrasts(X)=cbind(-3,-1,1
Hesen Peng-2 wrote:
>
> I created a plot function which used par(mfcol=c(2,1)) so that I could
> have two plots together using just one command.
>
> For exampe:
>
> plot.foo <- function(data){
> par(mfcol=c(2,1))
> hist(data)
> plot(data)
> }
>
> Later I wanted to show 4 of these foo objec
Le vendredi 03 avril 2009 à 22:30 +0200, mcnda...@mncn.csic.es a écrit :
> I already searched for information regarding the batch file operations
> within R. But I could not locate the information I need.
>
> Basically I have a doubt regarding the procedures on the batch use of
> several scrip
You need a comma (,) not a dot (.) in your
subscripting of the matrix. If I get the question
correctly, you want:
newTS2 <- perm[100, TS2]
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")
onyour
Hi.
newTS2 =(perm[100.TS2[1]]. perm[100.TS2[2]]. perm[100.TS2[3]]. ... ,
perm[100.TS2[2000]])
newTS2 is supposed to be a vector of 2000 values.
The first value is supposed come from a particular element of the matrix
called 'perm'.
I thought that
perm[100.TS2[1]]
would be valid code in R to r
Yes, I am considering I am a lucky man because you answered my question. Have
a great weekend!
Dieter Menne wrote:
>
>
> Feng Jingyu wrote:
>>
>> Hi For my purpose, I need to match variance estimates for each group from
>> R and SAS. They do match now.
>>
> Consider yourself a lucky man!
>
Hi listers,
I have a statistical question corcerning the posteriori probability of a
discriminant analysis.
I am calculating the probabilities under R using the formula.
posteriori_j=exp(q_j(y))/sum(q_j(y))
qj(y) is my quadratic discriminant function for the case where my covariance
matrix are pro
I already searched for information regarding the batch file operations
within R. But I could not locate the information I need.
Basically I have a doubt regarding the procedures on the batch use of
several script files (*.R).
How can I do this?
How can I define the order of files?
My intent
Hi For my purpose, I need to match variance estimates for each group from R
and SAS. They do match now. I notice there are still some difference between
those two. For example the standard errors of coeffieicints are different,
but I don't care those.
Dieter Menne wrote:
>
>
>
> To conserve y
Hi Gabor,
It seems that the problem depends on operating system.
I have recently switched from using R on Windows Vista to using it on Ubuntu
Linux.
I had already tried your two suggestions on Ubuntu and they produce the same
error:
Error in ylim[[idx]] : subscript out of bounds
According to
I used gls and it still does not provide me different estimates of variance
for each treatment group. Did I do anything wrong?
lm3<-gls(GSI~treatment,data=z,weights=varIdent(form=~treatment),method="ML")
summary(lm3)
Generalized least squares fit by maximum likelihood
Model: GSI ~ treatment
Thanks a lot. The problem is solved. It took me a while to understand the
output from the R. With little calculation, I am able to match results from
R to SAS.
Dieter Menne wrote:
>
>
> Feng Jingyu wrote:
>>
>> I used gls and it still does not provide me different estimates of
>> variance for
>
> > Anyway, I would like to Fourier-transform one column. So I say:
> >> fft(test1$vP)
> > Error in levels(x)[x] : invalid subscript type 'complex'
> >> test1$vP[1:10]
> > [1] 110 108 116 118 114 120 117 111 95 118
> > 166 Levels: - 0 1 10 100 101 102 103 104 105 106 107 108 109 11 110 111
>
Uwe Ligges-3 wrote:
>
>
>
> Melissa2k9 wrote:
>> Hi,
>>
>> I have written a for loop as such:
>>
>> model<-lm(Normalised~Frame,data=All,subset=((Subject==1)&(Filmclip=="Strand")))
>> summary(model)
>>
>> ###
>> #To extract just the Adjusted R squared
>>
Dear All
I wish to undertake a bivariate meta-analysis in R - does anyone know of any
readily available functions to do this ?
Many thanks
Andrea
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/
Le vendredi 03 avril 2009 à 20:01 -0400, Murray Cooper a écrit :
> For science yes. For pleasure I'll still take a pint instead of 570ml!
Yes, but do you realize that you'll have to pee in fl. oz ? Aie ...
Emmanuel Charpentier
___
On the boards for Ubuntu 8.10 64-bit, there were comments along the lines
that:
/etc/X11/rgb.txt
was missing.
However, even after I replace this file, and logged back out in, this
problem went away.
It's shocking that a file as old/basic as /etc/X11/rgb.txt can be removed -
I'm sure a lot of
69 matches
Mail list logo