Hi Xavier,
the reason you observe this feature is that in the 'constraint'
argument you should specify the values under the additive
parameterization, i.e., when in the second column of the matrix
supplied in 'constraint' you specify 2, then you need to provide the
easiness parameters (not
Chris,
You need to specify position = identity
library(ggplot2)
series - c('C2','C4','C8','C10','C15','C20')
series - factor(series, levels = series)
ids - c('ID1','ID2','ID3')
mydata -
data.frame(SERIES=rep(series,30),ID=rep(ids,60),VALUE=rnorm(180), dummy
= factor(1))
ggplot(mydata, aes(y =
milton ruser wrote:
Dear all
I have a code like
x-1:10
y1-x+runif(10)*2
y2-seq(0,50,length.out=10)+rnorm(10)*10
par(mfrow=c(1,2))
plot(y1~x)
plot(y2~x)
Now I would like to plot y1 and y2 on the same graph, with its two scales
(y1 on left and y2 on rigth side).
Hi Miltinho,
On 2/28/2008 1:42 AM, Robert Kopp wrote:
I am a beginner when it comes to using R, though fortunately I already know
something about statistics. I think factor analysis should be used sparingly,
but I occasionally use it. It doesn't seem to me that factanal() provides
Kaiser's Measure of
Hi, guess my problem has simple solution.
I want to extract ONLY Std. Errors of Max. Lik. estimates
(my_fit-mle(object,...)), the same as I can do with estimates by:
x-as. matrix(coef(my_fit)).
I could not find any function similar to 'coef(my_fit)', which extracts only
Standard Errors. So far
You can't calculate the var indeed of cov
On 28/02/2008, Megh Dal [EMAIL PROTECTED] wrote:
Thanks Henrique for this mail. It works fine. However I need one more
modification. When number of column is 1 then some error is coming :
library(zoo)
date.data = seq(as.Date(01/01/01, format =
Hi,
I've got a dataframe like this:
df =
data.frame(a=rnorm(100,1),b=rnorm(100,10),c=rnorm(100,100),d=rnorm(100,-100))
and I want to calculate sd1 for (a,b,c) for each entry, and sd2 for
(b,c,d) for each entry.
I don't seem to find the answer using aggregate or apply,
How can I do this?
threshold wrote:
Hi, guess my problem has simple solution.
I want to extract ONLY Std. Errors of Max. Lik. estimates
(my_fit-mle(object,...)), the same as I can do with estimates by:
x-as. matrix(coef(my_fit)).
I could not find any function similar to 'coef(my_fit)', which extracts only
Try this:
lapply(list(letters[1:3], letters[2:4]), function(x)apply(df[,x], 1, sd))
On 28/02/2008, Albert Vilella [EMAIL PROTECTED] wrote:
Hi,
I've got a dataframe like this:
df =
data.frame(a=rnorm(100,1),b=rnorm(100,10),c=rnorm(100,100),d=rnorm(100,-100))
and I want to calculate
Hi,
I'm trying to melt() some data for subsequent cast()ing and am
encoutering errors.
The overall process requires a couple of casts()s and melt()s.
Start Session 1##
## I have the data in a (fully) melted format and can cast it fine...
norm1[1:10,]
Pool SNP
Try this:
coef(summary(fit))[,2]
On 28/02/2008, threshold [EMAIL PROTECTED] wrote:
Hi, guess my problem has simple solution.
I want to extract ONLY Std. Errors of Max. Lik. estimates
(my_fit-mle(object,...)), the same as I can do with estimates by:
x-as. matrix(coef(my_fit)).
I could
On Thu, 28 Feb 2008, threshold wrote:
Hi, guess my problem has simple solution.
I want to extract ONLY Std. Errors of Max. Lik. estimates
(my_fit-mle(object,...)), the same as I can do with estimates by:
x-as. matrix(coef(my_fit)).
I could not find any function similar to 'coef(my_fit)',
Hey thanks Thierry! I learned two things here ... position=identity AND
x=dummy.
Can I ask where you learned these things. I've read a lot of the online
reference manual, the book, other presentations of ggplot2 and don't
recall seeing these, especially the x=dummy reference.
Does this come
vcov(my_fit) should get you the whole variance matrix, so
sqrt(diag(vcov(my_fit))) should get you ONLY the standard errors.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of threshold
Sent: Thursday, 28 February 2008 9:06 PM
To: r-help@r-project.org
Hi Neil,
Start Session 2##
## Now generate polar co-ordinates
t.norm1$polar.1 - log10(sqrt(t.norm1$Height.1^2 + t.norm1$Height.2^2))
t.norm1$polar.2 - atan((t.norm1$Height.2 / t.norm1$Height.1))
## And cast the polar data
t - melt(subset(t.norm1, select=
Hi Hadley,
On Thu, Feb 28, 2008 at 1:15 PM, hadley wickham [EMAIL PROTECTED] wrote:
I think the problem is that reshape adds some extra information to the
cast data.frame, but this info is no longer relevant when you've
removed some of the columns. Try as.data.frame to strip off this
Does anybody know how to do a intermediate linkage clustering in R?
Is there a command allready developed? Which package do I have to load?
Thanks in advance
yvo
--
View this message in context:
http://www.nabble.com/intermediate-linkage-clustering-tp15736379p15736379.html
Sent from the R help
Hi,
I have an unbalanced dataset on which I would like to perform a one-way anova
test using R (aov). According to Wannacott and Wannacott (1990) p. 333, one-way
anova with unbalanced data is possible with a few modifications in the
anova-calculations. The modified anova calculations should
Dear all,
I am looking for if non parametric linear regression is available in R. The
method I wish to use is described in the help of statsdirect statistical
software like this : This is a distribution free method for investigating a
linear relationship between two variables Y (dependent,
hello,
I have a last question on cohesive blocks: if there are multiple links
between some nodes in the graph, this is taken into account by
cohesive blocks? or the multiple links are simply ignored?
thank you,
Simone
__
R-help@r-project.org
Simone, they are currently ignored. Just like edge direction.
Gabor
On Thu, Feb 28, 2008 at 03:17:24PM +0100, Simone Gabbriellini wrote:
hello,
I have a last question on cohesive blocks: if there are multiple links
between some nodes in the graph, this is taken into account by
cohesive
Jorge Iván Vélez a écrit :
Dear R-list,
Does somebody know how can I read a HUGE data set using R? It is a hapmap
data set (txt format) which is around 4GB. After read it, I need to delete
some specific rows and columns. I'm running R 2.6.2 patched over XP SP2
using a 2.4 GHz Core 2-Duo
Thanks. Your suggestion works.
Daniel Malter wrote:
Does the code below solve your problem? If you have NAs in the same rows,
you have to use c or p as use= parameters. Otherwise you get the error
you described.
a=c(1,2,3,4,NA,6)
b=c(2,4,3,5,NA,7)
Thanks.
find(cor)
[1] package:fUtilities package:stats
Rolf Turner-3 wrote:
On 28/02/2008, at 11:11 AM, Ken Spriggs wrote:
I get the following
class(x1)
[1] numeric
class(x2)
[1] numeric
and:
cor(x1,x2)
Error in cor.default(x1, x2) : missing observations in cov/cor
Here's what happened...
stats::cor(x1,x2)
Error in stats::cor(x1, x2) : missing observations in cov/cor
Erik Iverson wrote:
OK, that is not the definition of cor in the stats package. Some add-on
package you are loading might be overwriting it.
What happens if you do
Dear R-helpers,
I would like to do a Spearman rank order test, and used the cor() function
with the method spearman.
It gives me a number (correlation coefficient?) , but how can I get the
p-value?
Thank you for the help in advance!
Regards,
Anne-Katrin
--
[[alternative HTML
SNN [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]:
Thanks for your help,
Can R plot the data in 3 dimention, with different colors for each
group ?
for exmple I would like to have the plot with respect to PC1, PC2
and PC3.
See if these answer your desires:
On Thu, 2008-02-28 at 16:17 +0100, Anne-Katrin Link wrote:
Dear R-helpers,
I would like to do a Spearman rank order test, and used the cor() function
with the method spearman.
It gives me a number (correlation coefficient?) , but how can I get the
p-value?
Thank you for the help in
I think you are getting a rounding or truncating
problem in the printing
Try print[lon[x])
and see what you get
--- Jingru Dai [EMAIL PROTECTED] wrote:
Hi, everyone
I got some problems when trying to subscript the
value of vector and
list, by using calculated indices.
Here is the
Hi Manisha,
This is a Bioconductor-specific question. Please repost on the bioc
listserv:
[EMAIL PROTECTED]
Best,
Jim
Manisha Brahmachary wrote:
Hi,
I am having troubles with creating an eSet and would appreciate any help on
the following problem.
I am trying to create
So you did have NAs in your data?
what do
any(is.na(x1))
and
any(is.na(x2))
give?
Ken Spriggs wrote:
Thanks. Your suggestion works.
Daniel Malter wrote:
Does the code below solve your problem? If you have NAs in the same rows,
you have to use c or p as use= parameters.
Dear useRs,
I'd like to announce a new package called geozoo, short for geometric
zoo. It's a compilation of functions to produce high-dimensional
geometric objects, including hypercubes and hyperspheres, Boy's
surface, the hyper torus and a selection of polytopes. For a complete
list, as well
Dear All,
I'd like to be able to have R store (in a list component) a compressed
data set, and then write it out uncompressed. gzcon and gzfile work in
exactly the opposite direction. What would be a good way to handle
this?
Details:
--
We have a package that uses C; part of the C
These methods are more commonly called robust regression or resistant
regression (it is not really non-parametric since you are trying to
estimate the slope which is a parameter, just not of a normal
distribution).
There are many methods for doing robust regressions, the book Modern
Applied
Ramon,
If you are looking for a solution to your specific application (as opposed
to a general compression/ decompression mechanism), it might be worth
checking out the Matrix package, which has facilities for storing and
manipulating sparse matrices. The sparseMatrix class stores matrices in
Dear useRs,
There is a new version 0.1-2 of the package surv2sample available on CRAN.
Users of the previous versions should update because a bug in the function
cif2.ks has been fixed.
General information about the package:
surv2sample provides various two-sample tests for right-censored
On Wed, 27-Feb-2008 at 10:06AM +, [EMAIL PROTECTED] wrote:
| I wrote some user defined function for my own. Now I want to get a
| mechanism
| so that every time I start R, those function will automatically be
| loaded in
| R without manually copying pasting. Can gurus here pls tell me
One solution is likely to be the Omegahat package Rcompression.
Otherwise, R does have internal facilities to do internal (gzip)
compression and decompression (e.g. see the end of
src/main/connections.c), and you could make creative use of serialization
to do the compression.
On Thu, 28 Feb
Suppose I have a 4-D array X with dimensions (dx, dy, dz, dp). I want
to collapse the first 3 dimensions of X to make a 2-D array Y with
dimensions (dx*dy*dz, dp). Instead of awkward looping, what is a good
way to do this? Is there a similar function like reshape in Matlab?
Thanks,
Gang
Hello,
I am using the function step.gam() from the 'gam' package (header info
from library(help=gam) included below) and have come across some
behavior that I cannot understand. In short, I have written a function
that 1) creates a dataframe, 2) calls gam() to create a gam object, then
3)
Hi R users!
I have a bit of a problem with using an hierarchical clustering algorithm:
a-c(1:15)
b-rep(seq(1:3), 5)
c-rnorm(15, 0,1)
d-c(sample(1:100, 15, replace=T))
e-c(sample(1:100, 15, replace=T))
f-c(sample(1:100, 15, replace=T))
data-data.frame(a,b,c,d,e,f)
q-data.frame(data$d,
Try this also:
apply(x, 4, rbind)
On 28/02/2008, Gang Chen [EMAIL PROTECTED] wrote:
Suppose I have a 4-D array X with dimensions (dx, dy, dz, dp). I want
to collapse the first 3 dimensions of X to make a 2-D array Y with
dimensions (dx*dy*dz, dp). Instead of awkward looping, what is a good
Thanks a lot for all the suggestions!
Gang
On Feb 28, 2008, at 3:20 PM, Henrique Dallazuanna wrote:
Try this also:
apply(x, 4, rbind)
On 28/02/2008, Gang Chen [EMAIL PROTECTED] wrote:
Suppose I have a 4-D array X with dimensions (dx, dy, dz, dp). I want
to collapse the first 3
Dear useRs,
Suppose we have loop:
res - c()
for (i in 1:10) {
x - rnorm(2)
res - c(res,x[2]-x[1])
}
and this loop for 10^5 cases runs about - for example 5 minutes.
When I add one zero (10^6) this loop will not end overnight but probably
hangs. This occurs
have you tried
res - rnorm(10^6)-rnorm(10^6)
?
it take 0.5 sec for me...
b
On Feb 28, 2008, at 3:30 PM, Minimax wrote:
Dear useRs,
Suppose we have loop:
res - c()
for (i in 1:10) {
x - rnorm(2)
res - c(res,x[2]-x[1])
}
and this loop for 10^5 cases runs about
Hi all,
We followed some books and sample codes and did some EMM estimation,
only to find it won't be able to generate forecast.
This is because in the stochastic volatility models we are estimating,
the volatilities are latent variables, and we want to forecast 1-step
ahead or h-step ahead
Hello, I'm reading Time Series Analysis and its Applilcations with R Examples
and I have a question...
I notice that in the book there are timeseries plots but without the x-axis
being labeled with dates. They are just numbers 1,...50,...100, etc. How
do I get the date to show up on the
All,
How does one replace plot symbols with say subject IDs when using xyplot? Or
superimpose them next to plot symbols? I searched the archives under
various key words but haven't had much. Any suggestions or links much
appreciated. Sample code below.
David
junk.frm = data.frame(ID =
Sounds like you want to use the filehash package which was written for just
such problems
http://yusung.blogspot.com/2007/09/dealing-with-large-data-set-in-r.html
http://cran.r-project.org/web/packages/filehash/index.html
or maybe the ff package
I've heard opinions that GARCH/SV volatility models
are not better on forecasting than simple exponential
moving average volatilities or even rolling window
historical vol.
Any practitioners mind comment?
--- Michael [EMAIL PROTECTED] wrote:
Hi all,
We followed some books and sample codes
Hi,
Jorge Iván Vélez wrote:
Dear R-list,
Does somebody know how can I read a HUGE data set using R? It is a hapmap
data set (txt format) which is around 4GB. After read it, I need to delete
some specific rows and columns. I'm running R 2.6.2 patched over XP SP2
in such a case, I would
Well, at this moment, I just want to know how to do the forecast. We
have spent so much time studying the estimation part...
now the coefficients are there, estimated, how to do the forecast?
On Thu, Feb 28, 2008 at 1:35 PM, elton wang [EMAIL PROTECTED] wrote:
I've heard opinions that GARCH/SV
On 2/28/08, Anne-Katrin Link [EMAIL PROTECTED] wrote:
I would like to do a Spearman rank order test, and used the cor() function
with the method spearman.
It gives me a number (correlation coefficient?) , but how can I get the
p-value?
You're probably looking for rcorr() from Hmisc. It
Dear Christos,
Thanks for your reply. Actually, I should have been more careful with
language: its not really a sparse matrix, but rather a ragged array
that results from a more compact representation we though of for the
hidden states in a Hidden Markov Model in many runs of MCMC. However,
it
see the zoo package. It has all the plotting for timeseries.
It has a nice Vignette too.
Also have a look at timeseries functions in Rmetrics.
(Rmetrics.org).
Good luck.
AA.
- Original Message -
From: joshv [EMAIL PROTECTED]
To: r-help@r-project.org
Sent: Thursday, February 28, 2008 4:04
read.table's colClasses= argument can take a NULL for those columns
that you want
ignored. Also see the skip= argument. ?read.table .
The sqldf package can read a subset of rows and columns (actually any
sql operation)
from a file larger than R can otherwise handle. It will automatically
set
I have done a cluster analysis doing:
1-clusNorth -hclust(dist(Artorious)^2, method=ward)
2-clusNorth$labels -Artorious$Name ## to show the case names and not
numbers
3-dend1 - as.dendrogram(clusNorth)
4-plot(dend1)
My Dendrogram is now showing the names of my cases in the dataframe on
the x
You might look at storing the data using R's raw data type...
-G
On Feb 28, 2008, at 5:38PM , Ramon Diaz-Uriarte wrote:
Dear Christos,
Thanks for your reply. Actually, I should have been more careful with
language: its not really a sparse matrix, but rather a ragged array
that results
On 2/28/08, David Afshartous [EMAIL PROTECTED] wrote:
All,
How does one replace plot symbols with say subject IDs when using xyplot? Or
superimpose them next to plot symbols? I searched the archives under
various key words but haven't had much. Any suggestions or links much
Is the date part of your data a POSIXct object?
If so,
plot( myData[,1], myData[,2] )
will label the x axis with dates.
See the help pages for date-time class objects:
?POSIXt
(POSIXt includes both POSIXct and POSIXlt; I tend to prefer POSIXct
and find it the easier of the two to work
On Thu, Feb 28, 2008 at 7:52 AM, Nauta, A.L. [EMAIL PROTECTED] wrote:
Hi,
I have an unbalanced dataset on which I would like to perform a one-way
anova test using R (aov). According to Wannacott and Wannacott (1990) p. 333,
one-way anova with unbalanced data is possible with a few
Hi the list
Is there any tutorial to learn codetools ? It seems to be a very
interesting pacakge, but the help gives not that much detail, and there
is not that much examples provided...
Christophe
__
R-help@r-project.org mailing list
Hello,
I am relatively new to R and learning its ins and outs. As part of a website I
am building, I need to read and write csv files directly from an SQL database.
Basically I want to convert R variables (dataframes) into CSV format, store
them as another R variable (as a properly formatted
I am having hard time tabulating data in a dataframe, and getting a single
table for an answer. I am trying to tabulate all counts for given
status on a given date.
I have a data frame such as:
delta_ts status count
1 2008-02-27 CLOSED 3
2 2008-02-27 NEW56
?capture.output
myoutput - capture.output(write.csv(...))
On Thu, Feb 28, 2008 at 7:34 PM, Tristan Casey [EMAIL PROTECTED] wrote:
Hello,
I am relatively new to R and learning its ins and outs. As part of a website
I am building, I need to read and write csv files directly from an SQL
Hi Guy,
Thanks for your help! Yes, we have the coefficient estimated using
EMM. And we followed those papers.
Just want to check my understanding about your suggestion:
Do you mean that after we obtain the estimated coefficients,
we run one simulation to obtain the whole sequence of latent
Is this what you want?
tapply(x$count, list(x$delta_ts, x$status), sum)
ASSIGNED CLOSED NEW RESOLVED
2008-02-212 NA 20
2008-02-220 0 61
2008-02-232 1 120
2008-02-247 4 162
2008-02-252
If you really want to do a loop, then preallocate your storage. You
were dynamically allocating each time through (or there abouts):
system.time({
+ res - numeric(10)
+ for (i in 1:10) {
+x - rnorm(2)
+res[i] - x[2] - x[1]
+}
+ })
user system elapsed
2.75
Try this:
xtabs(count ~., data)
Also look at ?ftable, ?prop.table, ?reshape and the reshape package.
On Thu, Feb 28, 2008 at 8:22 PM, obradoa [EMAIL PROTECTED] wrote:
I am having hard time tabulating data in a dataframe, and getting a single
table for an answer. I am trying to tabulate all
I used ?image function to do that, like below :
require(grDevices) # for colours
x - y - seq(-4*pi, 4*pi, len=27)
r - sqrt(outer(x^2, y^2, +))
image(x, y, r, col=gray((0:32)/32))
However my next problem to add a color pallet for color description [as shown
in following link]. If anyone here
Try something like this:
require(grDevices) # for colours
x - y - seq(-4*pi, 4*pi, len=27)
r - sqrt(outer(x^2, y^2, +))
image(x, y, r, col=gray((0:32)/32))
colors - colorRampPalette(c('red', 'yellow', 'blue')) # create you
color spectrum
image(x,y,r, col=colors(100))
On Thu, Feb 28, 2008 at
Hi,
I am using the:
pcf.aov-aov(meas~op+part, data=pcf.ex2),
command to perform a two way ANOVA. When I save the:
sumpcf- summary.aov(pcf.aov),
result of the summary.aov command in a variable I need to access the
individual pieces of information in the summary. The summary appears
to be a
Hi,
Since nobody replied, I'd rather post this self-reply for the sake of
documenting the solution.
It appears that xYplot, unlike standard xyplot (or coplot to that matter)
does not accept factors as x variable in formula. With x converted to numeric
everything worked as expected. This small
Keith
Try names(sumpcf) or str(sumpcf). That should help you find what you
want.
Incidentally, simply summary(pcf.aov) will do - R uses the appropriate
method based on the type of object.
HTH
Peter Alspach
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Thanks for your help.
I downloaded the scatterplot3d package.
plot3d(pr$x, col = c(red, blue)[c(rep(1, 100), rep(2, 15))], pch=20)
where pr$x is the object of the PCA. this works but the graph does not look
good.
the other option that I tried is
scatterplot3d(pr$x, type=p, highlight.3d=T,
Hi,
What is quantile residuals?
Thank you so much in advance.
Be a better friend, newshound, and
__
R-help@r-project.org mailing list
What is quantile residuals?
See
Dunn, Peter K. and Smyth, Gordon K. (1996). Randomized Quantile
Residuals. Journal of Computational and Graphical Statistics,
volume 5, issue 3, 236–244.
Or see ?qresid in R package statmod.
P.
--
Dr Peter Dunn | dunn at usq.edu.au
Faculty of Sciences,
Hi Jim, i think you could not get my point. I did not want to put red-blue
color there. I want to put a pallet which will describe the values of r. please
have a look on following :
http://bp0.blogger.com/_k3l6qPzizGs/RvDVglPknRI/AKo/itlWOvuuOtI/s1600-h/pairwise_kl_window60.png.
Please
On Thu, 28 Feb 2008, jim holtman wrote:
?capture.output
myoutput - capture.output(write.csv(...))
It would be better to write directly to a text connection: see the 'file'
argument to write.csv.
On Thu, Feb 28, 2008 at 7:34 PM, Tristan Casey [EMAIL PROTECTED] wrote:
Hello,
I am
Has your question been answered yet?
x=c(1,2,4,3,6,8)
y=c(3,2,5,7,4,6)
cor.test(x,y,method=spearman)
And that's how you extract the p-value:
cor.test(x,y,method=s)$p.value
Cheers,
Daniel
--
Abstrakthelfer helfen wenig
--
R users,
My intention is to take factors out of DF, create list of tables and
export these tables separately using write.table or sink function.
write.table writes tables out as DF:s, should I use sink instead?
Here is my example:
a - data.frame(indx =1:20,
var1 =
Dear friends,
The user coordiante system in the R graphics is easy to understand as
it simply corresponds to the range of values on the axes of the plot.
However, sometimes, we want to kown the coordinates of a region in other
system, e.g., the normal coordinate system whose origin is the
82 matches
Mail list logo