Well, R has a by() function that does what you want, and its help page
contains an example of doing regression by group.
(There are other ways.)
On Fri, 3 Aug 2007, Paul Young wrote:
> So I am trying to perform a robust regression (fastmcd in the robust
> package) on a dataset and I want to per
?cumsum
--- zahid khan <[EMAIL PROTECTED]> wrote:
> I want to calculate the commulative sum of any numeric vector with the
> following command but this following command does not work "comsum"
> My question is , how we can calculate the commulative sum of any numeric
> vector with above comma
I want to calculate the commulative sum of any numeric vector with the
following command but this following command does not work "comsum"
My question is , how we can calculate the commulative sum of any numeric
vector with above command
Thanks
Zahid Khan
Lecturer in Statistics
Department
On 8/2/07, Emilio Gagliardi <[EMAIL PROTECTED]> wrote:
> Hi Thierry and Hadley,
>
> Thanks for your help! I got it working almost 100% to what I want. My last
> questions are simple I think ;)
> 1) How can I pass a label to colour and assign the color at the same time?
> The auto-selection of color
On 03/08/2007 7:16 PM, Christopher Green wrote:
> Is there an easy way to open an R script file in the R Editor found in
> more recent versions of R on Windows via a file association? I am looking
> for functionality akin to how the ".ssc" file extension works for S-Plus:
> upon double-clicking on
Hi Bert,
> -Original Message-
> From: Bert Gunter [mailto:[EMAIL PROTECTED]
> Sent: Fri 8/3/2007 3:19 PM
> To: Steven McKinney; r-help@stat.math.ethz.ch
> Subject: RE: [R] FW: Selecting undefined column of a data frame (was
> [BioC]read.phenoData vs read.AnnotatedDataFrame)
>
> I suspe
So I am trying to perform a robust regression (fastmcd in the robust
package) on a dataset and I want to perform individual regressions based
on the groups within the data. We have over 300 sites and we want to
perform a regression based on the day of week and the hour for every
site. I was wonde
Is there an easy way to open an R script file in the R Editor found in
more recent versions of R on Windows via a file association? I am looking
for functionality akin to how the ".ssc" file extension works for S-Plus:
upon double-clicking on a ".R" file, Rgui.exe starts up and loads the script
fi
Hi,
I would like to obtain the dispersion parameter for a quasipoisson model for
later use in calculating QAIC values for model comparison.Can anyone suggest a
method of how to go about doing this?
The idea I have now is that I could use the residual deviance divided by the
residual degr
On Thursday 26 July 2007 10:45, Frank E Harrell Jr wrote:
> Dylan Beaudette wrote:
> > On Thursday 26 July 2007 06:01, Frank E Harrell Jr wrote:
> >> Note that even though the ROC curve as a whole is an interesting
> >> 'statistic' (its area is a linear translation of the
> >> Wilcoxon-Mann-Whitney
I suspect you'll get some creative answers, but if all you're worried about
is whether a column exists before you do something with it, what's wrong
with:
nm <- ... ## a character vector of names
if(!all(nm %in% names(yourdata))) ## complain
else ## do something
I think this is called defensive
> What would break is that three methods for doing the same thing would
> give different answers.
>
> Please do have the courtesy to actually read the detailed explanation you
> are given.
Sorry Prof. Ripley, I am attempting to read carefully, as this
issue has deeper coding/debugging implicatio
Hi all,
I have the following unbalanced data set :
F1<-rep("F1",29)
F2<-rep("F2",83)
F3<-rep("F3",18)
F4<-rep("F4",11)
F5<-rep("F5",25)
F6<-rep("F6",10)
all.fac<-c(F1,F2,F3,F4,F5,F6)
batch1<-rep("B1",29)
batch2<-rep("B2",83)
batch3<-rep("B2",18)
batch4<-rep("B1",11)
batch5<-rep("B2",25)
batch6<
> This looks odd. It is a standard split-plot layout, right? 3
> groups of 13 subjects, each measured with two kinds of Rsp = 3x13x2
> = 78 observations.
Yes, that is right.
>
> In that case you shouldn't see the same effect allocated to
> multiple error strata. I suspect you forgot to dec
Gang Chen wrote:
> Thanks a lot for clarification! I just started to learn programming in
> R for a week, and wanted to try a simple mixed design of balanced
> ANOVA with a between-subject factor
> (Grp) and a within-subject factor (Rsp), but I'm not sure whether I'm
> modeling the data correctl
> -Original Message-
> From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
> Sent: Fri 8/3/2007 1:05 PM
> To: Steven McKinney
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] FW: Selecting undefined column of a data frame (was [BioC]
> read.phenoData vs read.AnnotatedDataFrame)
>
> I've
Thanks a lot for clarification! I just started to learn programming
in R for a week, and wanted to try a simple mixed design of balanced
ANOVA with a between-subject factor
(Grp) and a within-subject factor (Rsp), but I'm not sure whether I'm
modeling the data correctly with either of the com
Gang:
I think what Peter is asking for is for you to put some of your output
in an email. If the values of the fixed effects are the same across
models, but the F-tests are different, then there is a whole other
thread we will point you to for an explanation. (I don't presume to
speak for other pe
I've since seen your followup a more detailed explanation may help.
The path through the code for your argument list does not go where you
quoted, and there is a reason for it.
Generally when you extract in R and ask for an non-existent index you get
NA or NULL as the result (and no warning), e.
Thanks for the response!
It is indeed a balanced design. The results are different in the
sense all the F tests for main effects are not the same. Do you mean
that a random interaction is modeled in the aov command? If so, what
would be an equivalent command of aov to the one with lme?
Than
Thanks Prof Ripley,
I used double indexing (if I understand the doc correctly)
so my call was
> foo[, "FileName"]
I traced through each line of `[.data.frame`
following the sequence of commands executed
for my call.
In the code section
if (missing(i)) {
if (missing(j) && drop && le
Gang Chen wrote:
> I have a mixed balanced ANOVA design with a between-subject factor
> (Grp) and a within-subject factor (Rsp). When I tried the following
> two commands which I thought are equivalent,
>
> > fit.lme <- lme(Beta ~ Grp*Rsp, random = ~1|Subj, Model);
> > fit.aov <- aov(Beta ~ R
On 8/3/2007 3:01 PM, Liaw, Andy wrote:
> Here's one possibility:
>
> The file "garbage.R" has
>
> x <- rnorm(100)
> print(summary(x))
>
> You can do:
>
> cmds <- parse(file="garbage.R", n=NA)
>
> and when you want to execute those commands, do
>
> eval(cmds)
And since it's Friday aft
You are reading the wrong part of the code for your argument list:
> foo["FileName"]
Error in `[.data.frame`(foo, "FileName") : undefined columns selected
[.data.frame is one of the most complex functions in R, and does many
different things depending on which arguments are supplied.
On Fri,
Well, it seems that having a square page works...If you modify the width or
height so that they are not equal, it goes back to the same problem. I guess
this is good enough for now.
Miruna
- Original Message -
From: "John Kane" <[EMAIL PROTECTED]>
To: "Vorlow Constantinos" <[EMAIL PROT
Hi all. How do I compute a Monday Open to Friday Close weekly return in
Rmetrics from daily data? Thanks!
John
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
Follow-up
I seem to have manged to get the eps file to work
using:
postscript("C:/temp/figure.eps", horizontal=F,
paper="special", height=8, width=8, pointsize=12)
Exactly why I'm not sure since I just copied some old
code that I had used a year or so ago.
--- Vorlow Constantinos <[EMAIL PROTE
Here's one possibility:
The file "garbage.R" has
x <- rnorm(100)
print(summary(x))
You can do:
cmds <- parse(file="garbage.R", n=NA)
and when you want to execute those commands, do
eval(cmds)
Andy
From: Dennis Fisher
>
> Colleagues:
>
> I have encountered the following situation:
None of the suggestions work for me, either. I see Costas's plot just like
mine, i.e., incorrectly. I tried modifying the Orientation to Auto,
selecting all the Options, and using paper="special". It does not work. I am
using GSView 4.8 under Windows.
Miruna
- Original Message -
From
I don't know about for Miruna but it does not work for
me.
I tried
postscript ("figure.eps", paper="letter")
http://ca.geocities.com/jrkrideau/R/eps.figure.pdf
&
postscript("figure.eps, paper="special", width=5,
height=4)
with similaar same results.
Interstingly enough figure.eps imports com
I have a mixed balanced ANOVA design with a between-subject factor
(Grp) and a within-subject factor (Rsp). When I tried the following
two commands which I thought are equivalent,
> fit.lme <- lme(Beta ~ Grp*Rsp, random = ~1|Subj, Model);
> fit.aov <- aov(Beta ~ Rsp*Grp+Error(Subj/Rsp)+Grp,
Thank you very much for your help. I have installed the latest versions
of R and lattice are installed, and now the 'fill' argument (instead of
bg) gives me what I want.
[EMAIL PROTECTED] a écrit :
> On 8/2/07, Sébastien <[EMAIL PROTECTED]> wrote:
>
>> Dear R-users,
>>
>> I am using plot sy
I see now that for my example
> foo <- data.frame(Filename = c("a", "b"))
> foo[, "FileName"]
NULL
the issue is in this clause of the
"[.data.frame" extractor.
The lines
if (drop && length(y) == 1L)
return(.subset2(y, 1L))
return the NULL result just before the
error ch
Merged file can become:
... current file1 contents ...
f <- function() {
... current file 2 contents ...
}
and then source that followed by running your middle code
followed by running f().
Of course, you may need to make some changes in the body
of f due to the changed scoping that this introdu
Ah. Very good point. I stand corrected.
---Kyle.
>>> [EMAIL PROTECTED] 08/03/07 10:32 AM >>>
On 03-Aug-07 16:42:33, Kyle. wrote:
> Tom:
>
> That's a good question. AIC, as i'm sure you know, is usually
> calculated as 2k-2ln(L), where k is the number of free parameters in
> the model, a
On 03-Aug-07 16:42:33, Kyle. wrote:
> Tom:
>
> That's a good question. AIC, as i'm sure you know, is usually
> calculated as 2k-2ln(L), where k is the number of free parameters in
> the model, and L is the log-likelihood of the model. The goal of
> AIC--and the reason one normally tries to
Hi all,
What are current methods people use in R to identify
mis-spelled column names when selecting columns
from a data frame?
Alice Johnson recently tackled this issue
(see [BioC] posting below).
Due to a mis-spelled column name ("FileName"
instead of "Filename") which produced no warning,
Ali
While I don't use such a workflow, one option would be to place the
series of commands in a function, and then run that as appropriate.
do.initialisation <- function() {
...
}
do.cleanup <- function() {
}
Best wishes,
Mark
On 03/08/07, Dennis Fisher <[EMAIL PROTECTED]> wrote:
> Colleagues
Colleagues:
I have encountered the following situation:
SERIES OF COMMANDS
source("File1")
MORE COMMANDS
source("File2")
Optimally, I would like File1 and File2 to be merged into a single
file (FileMerged). However, if I wrote the following:
SERIES OF CO
Tom Willems var.fgov.be> writes:
> I have a question about the Akaike Information Criterion in the R
> output.
> Normally you would want it to be as small as possible, yet when i check up
> the information in my study books, the AIC is usually displayed as a
> negative number. In the exercis
Tom:
That's a good question. AIC, as i'm sure you know, is usually
calculated as 2k-2ln(L), where k is the number of free parameters in
the model, and L is the log-likelihood of the model. The goal of
AIC--and the reason one normally tries to select a model with minimal
AIC--is to minimi
See ?save
Also you might be able to use the Ryacas package to simplify your derivative.
See Simplify in 5.5 of:
http://ryacas.googlecode.com/svn/trunk/inst/doc/Ryacas.pdf
More info at:
http://code.google.com/p/ryacas/
On 8/2/07, Yuchen Luo <[EMAIL PROTECTED]> wrote:
> Dear Friends.
> I have a ve
Dear all,
Now everything is fine. Thanks a lot for your responses.
After the first attempts did not work, I moved some perl files into the
C:\Programme\R\R-2.5.1\share\perl
folder.
However, also this did not help either.
Finally, after you emails, I (re)installed R, Rtools and Perl (and rem
On Fri, 2007-08-03 at 16:23 +0200, Luca Laghi wrote:
> Dear list members,
> I have created seven objects, from a to g, so that ls() gives me
> [1] "a" "b" "c" "d" "e" "f" "g"
>
> how can I automatically change their names in
>
> "a1" "b1" "c1" "d1" "e1" "f1" "g1"
>
> It seems simple, ut it is dr
We are happy to announce that the R user conference
useR! 2008
is scheduled for August 12-14, 2008, and will take place at the
University of Dortmund.
As for the predecessor conferences, the program will consist of two parts:
invited lectures and user-contributed sessions (abstract submission
On 8/2/07, Sébastien <[EMAIL PROTECTED]> wrote:
> Dear R-users,
>
> I am using plot symbols given by pch=21:25 in a xyplot. The background
> color of these symbols can be defined by 'fill' in the panel argument,
> however I have a hard time to find how to define the same background
> color in the k
Maybe use the sink() function
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Yuchen Luo
> Sent: Thursday, August 02, 2007 10:17 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Saving an expression to a file
>
> Dear Friends.
> I have a very long
Dear fellow R-ussers,
I have a question about the Akaike Information Criterion in the R
output.
Normally you would want it to be as small as possible, yet when i check up
the information in my study books, the AIC is usually displayed as a
negative number. In the exercises it is given as " -
Dear Friends.
I have a very long expression and I use function D to find its derivative,
which will be even longer. I save the resulting expression in a variavle,
say bbb. But when I tried to display bbb on the screen, the R screen is not
long enough for me to view it. Is there a way to save the ex
Dear R-users,
I am using plot symbols given by pch=21:25 in a xyplot. The background
color of these symbols can be defined by 'fill' in the panel argument,
however I have a hard time to find how to define the same background
color in the key. I tried different options like using the auto.key
a
On 8/3/2007 11:28 AM, justin bem wrote:
> It not too simple what ls return the variable that have been create in your
> environment even if you change their names, ls will not return "a1" "b1" ...
>
> The names attribute in OOP of an object is just an attribute and it is
> different with an inst
It not too simple what ls return the variable that have been create in your
environment even if you change their names, ls will not return "a1" "b1" ...
The names attribute in OOP of an object is just an attribute and it is
different with an instance of the object. ls() show instance
But you ca
Thanks, I figured it out after I realized my mistake here is the
corrected one. But I will certainly look at the teaching demos package.
left<- -1.96
right<- 1.96
mu1<-rnorm(10,20,5)
d<-(density(mu1))
x.tmp<-d$x
y.tmp<-d$y
x<-x.tmp
y<-y.tmp
x.int1<-20 + (5*1.96)
x.int2<-20 - (5*1.96)
a<-which(
On 8/3/2007 10:23 AM, Luca Laghi wrote:
> Dear list members,
> I have created seven objects, from a to g, so that ls() gives me
> [1] "a" "b" "c" "d" "e" "f" "g"
>
> how can I automatically change their names in
>
> "a1" "b1" "c1" "d1" "e1" "f1" "g1"
>
> It seems simple, ut it is driving me mad.
On Fri, 3 Aug 2007, Duncan Murdoch wrote:
On 8/3/2007 9:19 AM, Jens Oehlschlägel wrote:
Dear R .Call() insiders,
Can someone enlighten me how to properly finalize external pointers in C code
(R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the
finalizer set in R_RegisterCFi
Look at the power.examp and run.power.examp functions in the
TeachingDemos package. Do these do what you want? If not you can look
at the code in them to see how to fill part of the area under the curve.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Hea
I am trying to shade the critical regions for normal distribution with
different means and making overlaps of the plots to explain Type I and
Type II errors. I tried the following. If I calculate the z score and as
I did below, can I use it to pick regions from the original data? I
think I am makin
It's not clear exactly what you want, but you may want to look at the
layout function, or the subplot function in the TeachingDemos package.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
> -Original Message-
> From:
Dear list members,
I have created seven objects, from a to g, so that ls() gives me
[1] "a" "b" "c" "d" "e" "f" "g"
how can I automatically change their names in
"a1" "b1" "c1" "d1" "e1" "f1" "g1"
It seems simple, ut it is driving me mad.
Thank you very much for your help.
Luca Laghi
__
On 8/3/2007 9:19 AM, Jens Oehlschlägel wrote:
> Dear R .Call() insiders,
>
> Can someone enlighten me how to properly finalize external pointers in C code
> (R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the
> finalizer set in R_RegisterCFinalizer?
>
> I succeeded registerin
I don't understand your question but there is a package called VARs
that may be helpful to you.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of liu lu
Sent: Friday, August 03, 2007 8:39 AM
To: [EMAIL PROTECTED]
Subject: [R-SIG-Finance] question on analyzi
Dear R .Call() insiders,
Can someone enlighten me how to properly finalize external pointers in C code
(R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the
finalizer set in R_RegisterCFinalizer?
I succeeded registering a finalizer that works when an R object containing an
ext
Please check that you have installed a suitable environment (tools,
compiler etc.) as mentioned in the R Installation and Administration
manual. Öooks like your version of Perl is corrupted.
I got with your C program:
d:\aaa>R CMD SHLIB dmypow.c
making dmypow.d from dmypow.c
gcc -It:/R/includ
Do you have the Orientation menu set to 'Auto'?
The effect described seems that if 'Rotate media' is selected, which it
should not be.
The files look fine to me in GSView 4.8 on Windows and other viewers on
Linux. I agree with Uwe that it is a viewer issue (most reported
postscript/PDF are).
Dear all,
I have problems to compile a DLL for Windows XP with R version 2.5.1
(2007-06-27).
See output below:
C:\AZ_DATEN\C, C++\BE_speedup>R CMD SHLIB dmypow.c
Goto undefined subroutine &DynaLoader::bootstrap_inherit at C:\Programme\R\R-2.5
.1\share\perl/XSLoader.pm line 80.
Compilation fail
Hi,
My vanilla code works fine...
See also attached .eps file (seperate email sent directly to you)
> r<-rnorm(100)
> postscript("figure.eps")
> plot.ts(r)
> dev.off()
Also this works ok as you have been told already:
> paper="special" in the postscript() call.
If you see my eps file wrongly
Hi Tom
It looks as if you are reading in genepix files. I believe the format for the
start lines includes a second line to say how many lines to skip. Something
like this, specifying 27 lines to skip:
ATF 1
27 43
Type=GenePix Results 1.4
DateTime=2003/11/14 17:18:30
If so
R-help,
I have a plot in which I use the following:
text(1 , 2, expression(61*degree ~ paste("N")), font = 2)
but the "expression(61*degree ~ paste("N"))" will not come out in font
= 2.
However "cex=2" will work.
What is the problem?
Thanks in advance.
> version
_
Please read the last line of every message
to r-help:
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
We don't know what you did.
On 8/3/07, Tom Cohen <[EMAIL PROTECTED]> wrote:
> Thanks to Ted and
I seem to see the same problem that Miruna gets just
to confirm that it is not just her set-up.
I'm using GSview4.8 if that helps
--- Uwe Ligges <[EMAIL PROTECTED]>
wrote:
>
>
> Miruna Petrescu-Prahova wrote:
> > Hi
> >
> > I am trying to save some plots in a postscript
> file. When I g
Thanks to Ted and Gabor for your response.
I apology for not being clear with my previous description of the problem. I
tried with your suggestions using readLines but couldn't make it work. I now
explain the problem in more details and hope that you can help me out.
I have 30 data fil
Ok, then tapply() might be your friend:
set.seed(1)
b <- rbinom(10,6,0.3)
c <- rbinom(10,6,0.9)
w <- trunc(runif(10)*3)
b;c;w
table(b, c)
tapply(w, list(b, c), sum)
Is this what you were looking for?
/Johan
G. Draisma skrev:
> Thanks Johan,
>
> I realize that I did not use the right example.
Try this
result <- summary(prcomp(USArrests))
names(result)
M <- result$importance
M[2,]
The "labels" are the dimnames of the "importance" matrix. They only
"show up" when the matrix is printed. If you wish, you can remove
them with dimnames(M) <- NULL.
--
Bjørn-Helge Mevik
_
Hi,
Does anyone know if exist a library or a method to perform "functional
logistic regression" in R?
I have the FDA package, but I think it makes possible to do at most
functional linear regression with the fRegress routine, not logistic
regression.
Is there such a thing like fGLM from S+FDA lib
Miruna Petrescu-Prahova wrote:
> Hi
>
> I am trying to save some plots in a postscript file. When I generate the
> plots in the main window, they appear correctly - their orientation is
> landscape (i.e., horizontal). However, when I open the .ps file with GSview,
> the whole page appears v
75 matches
Mail list logo