reply is inline
Hello Gaurav,
The function:
VaR(tstock[,2],alpha=0.01) # gives the same VaR as above with historical
simulation
VaR
-2.86
but i tried this function for normal distribution:
VaR.norm (tstock[,2],p=0.99)$VaR
Error in VaR.norm(tstock[, 2], p = 0.99) :
Negative
Hi Saore
***Please always mark a copy to the R-help list, it may be helpfull to
many, you have forgotten twice***
*** Do Reply to all with history ***
:-) cheers
YOU ARE THE BEST :)
I have some problems understanding R, but R and I will be friends in the
future hehe :)
I have another
John Kane wrote:
Have a look at the Hmisc package:sas.get or
sasxport.get. In either case you need to have a
working SAS installation on the same machine.
Another way, although you lose label is simply to
export the SAS data file as a csv or delim file and
import it.
I'm also looking
Thank you all for your answers... To summarize,
1. with(X, ifelse(V1 V2 | V1 V3, 1, 0))
2. ifelse((foo$x foo$y) | (foo$x foo$z), 1, 0)
3. with(foo, (x y) * (x z))
were the responses to my question (see below).
Kindly,
Greg
--- Original post ---
I have a
Oh sry, I forgot to add the R-help list.
Thanks a lot for your help Guarav!
2007/5/11, [EMAIL PROTECTED] [EMAIL PROTECTED]:
Hi Saore
***Please always mark a copy to the R-help list, it may be helpfull to
many, you have forgotten twice***
*** Do Reply to all with history ***
:-) cheers
The earth package is now available on CRAN.
Earth builds models using Friedman's MARS.
Earth's principal advantages over the existing function mda::mars are that
it is much faster and provides plotting and printing methods. The general
purpose model plotting function plotmo may also be useful
Its not clear to me what you want but play around with these
forms of merge.zoo:
merge(x, y) # all = TRUE
merge(x, y, all = FALSE)
merge(x, y, all = c(TRUE, FALSE))
merge(x, y, all = c(FALSE, TRUE))
On 5/11/07, Patnaik, Tirthankar [EMAIL PROTECTED] wrote:
Achim,
Thanks so much! I
Yes, rounding error does happen in real-life computation. It would be
extraordinary to compile the correlation of real data and get exactly 0:
this would require that the data could be represented exactly, for
example.
You might find ?zapsmall helpful.
On Thu, 10 May 2007, Takatsugu
Hi
[EMAIL PROTECTED] napsal dne 10.05.2007 17:59:22:
or
with(foo, (x y) * (x z))
Should not it be
with(foo, ((x y) | (x z))*1)
Regards
Petr
On 5/10/07, jim holtman [EMAIL PROTECTED] wrote:
You don't need apply. Just do
foo$result - ifelse((foo$x foo$y) | (foo$x
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
fm1Indom.nls - nls(conc~SSbiexp(time,A1,lrc1,A2,lrc2), data=Indometh)
Hi
[EMAIL PROTECTED] napsal dne 11.05.2007 11:30:28:
Hello
I have a problem.
I have a plot, and have made the writing larger with cex.axis and
cex.lab, and
i is working great, BUT the writing is bigger than the window... for
example,
the y-axis writing misses the top of all letters.
Mielke Hans wrote:
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
fm1Indom.nls - nls(conc~SSbiexp(time,A1,lrc1,A2,lrc2),
Hello
I have a problem.
I have a plot, and have made the writing larger with cex.axis and cex.lab, and
i is working great, BUT the writing is bigger than the window... for example,
the y-axis writing misses the top of all letters.
Does anyone know how to change the window or something so you
Hi
[EMAIL PROTECTED] napsal dne 11.05.2007 11:12:21:
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
fm1Indom.nls -
Petr PIKAL wrote:
Hi
[EMAIL PROTECTED] napsal dne 11.05.2007 07:26:00:
Doea anyone know how to compute components of variance analysis? For
example,
I have the score of pupils on a test. Each pupil belongs to a school and
within each school I may have several
The example works fine for me on R 2.5.0 and WinXP...
Mielke Hans wrote:
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
On 11/05/2007 7:07 AM, Vittorio wrote:
Given the string
mystr - (Preconsuntivo del giorno gas 10 maggio
2007)Tj
I'm trying to detect and eliminate the string )Tj at the
very end of mystr by means of
gsub(rx2,,mystr) BUT preparing the
matching regexp string a warning pops up
rx2
Given the string
mystr - (Preconsuntivo del giorno gas 10 maggio
2007)Tj
I'm trying to detect and eliminate the string )Tj at the
very end of mystr by means of
gsub(rx2,,mystr) BUT preparing the
matching regexp string a warning pops up
rx2 - \)Tj$
Warning
messages:
1: '\)' is an
Hi,
Can anyone recommend one or more good sample datasets for multivariate
longitudinal data? (eg. a dataset containing a mixture of continuous,
categorical and date/time variables) I'm looking for something which
I can use for testing and examples for my ggplot graphics package. A
selection of
hie
l have obtained a logrank statistic and would like to get the normal
version from the same data eg sqrt(chiqsqr)with 1 df ~n(1,0)
is this possibe using R or Do l have to programme it
thanks
-
Bored stiff? Loosen up...
I have a samll package that works well and complies nicly on WinXP,
using R-2.4.1
Now I want to add a document so i make a folder inst\doc and put the
.tex and .pdf in there.
But the complation then crashes. Is this because the installin expects
some file to be present in inst if an inst folder
BXC (Bendix Carstensen) wrote:
I have a samll package that works well and complies nicly on WinXP,
using R-2.4.1
Now I want to add a document so i make a folder inst\doc and put the
.tex and .pdf in there.
But the complation then crashes. Is this because the installin expects
some file to
Hi, R users
I am trying to use EM algorithmto estimate a latent class model of discrete
choice. The basic model is a logit model which has two variables X=(X1,X2) and
the utility is defined as v = Beta*X. There are 3 classes of individuals each
has its own Beta values, so Beta is a 3*2
library(lme4)
library(coda)
library(languageR)
fit = lmer(Reaction~Days + (1|Subject) + (0+Days|Subject),
data=sleepstudy)
pvals.fnc(fit)$random
# compare with...
samp = mcmcsamp(fit, n=1, trans=FALSE)
HPDinterval(samp)
densityplot(samp, plot=F)
# 'pvals.fnc' reports sigma instead of
Isn't this rather closely related to the (more or less classic) bin packing and
knapsack problems? The 'hardness' of the problem is combinatoric (NP) and that
is statistical, but the answers aren't particularly statistical. Both have been
studied quite a lot for pragmatic reasons (packing
one option is the following:
times - 1:5
rho - 0.5
sigma - 2
###
H - abs(outer(times, times, -))
V - sigma * rho^H
p - nrow(V)
V[cbind(1:p, 1:p)] - V[cbind(1:p, 1:p)] * sigma
V
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of
Dimitris Rizopoulos wrote:
one option is the following:
times - 1:5
rho - 0.5
sigma - 2
###
H - abs(outer(times, times, -))
V - sigma * rho^H
p - nrow(V)
V[cbind(1:p, 1:p)] - V[cbind(1:p, 1:p)] * sigma
V
Hmm, I'd rather use
x - diag(5)
x - sigma *
Hi, all
When I am using mle.cv(wle), I find a interesting problem: I can't do
leave-one-out cross-validation with mle.cv(wle). I will illustrate the
problem as following:
xx=matrix(rnorm(20*3),ncol=3)
bb=c(1,2,0)
yy=xx%*%bb+rnorm(20,0,0.001)+0
Hi All.
I need to create a first-order autoregressive covariance matrix
(AR(1)) for a longitudinal mixed-model simulation. I can do this
using nested for loops but I'm trying to improve my R coding
proficiency and am curious how it might be done in a more elegant
manner.
To be clear, if there
Kim’s EZ Recipe for….
SAS TO R, perfectly formatted table with no loss of data
• In SAS: Export SAS DB as access db
• In R go to directory where access db is stored
• Use package RODBC
#R code
#Create connection object (Can set up DSN but I’m too lazy to)
Hopefully quick question. I would like to populate a list with n
objects using a for loop, so within the loop (i to n) I need to refer
to a list as example.list[[i]] . This requires that I create a
example.list[[i]] with n objects before the for loop. How do I do
this? With matrices it
Hi everyone,
sorry if this was discussed before (and in this situation, could you
please point me to the discussion in the archive? My search didn't
seem to be effective).
Is there a way of getting the names of objects in a .rda file without
having to load it?
Thank you very much,
What is 'cv.glm'? That's almost certainly where the time is going, and
there are fast methods of LOO cross-validation for linear models (as
distinct from glms). If this is the function of that name from package
boot, that comment certainly applies.
Do you know about the relationship between
sorry every one. I figured it out. I didn't realize that you could add
objects so easily. I just went with
example.list - list(1)
Sam
Sam Field wrote:
Hopefully quick question. I would like to populate a list with n
objects using a for loop, so within the loop (i to n) I need to refer
I tried writing a textual comparison program in R, but found that it
is too slow for my purposes. I need to make about 145 million
comparisons of the word patterns in pieces of text. I basically
compare vectors that contain count data on a multitude of words and
find ones that are similar to
mylist - as.list (matrix(1:5))
might work. Note the elements of the list are not
empty
--- Sam Field [EMAIL PROTECTED] wrote:
Hopefully quick question. I would like to populate
a list with n
objects using a for loop, so within the loop (i to
n) I need to refer
to a list as
On 5/11/2007 11:53 AM, Benilton Carvalho wrote:
Hi everyone,
sorry if this was discussed before (and in this situation, could you
please point me to the discussion in the archive? My search didn't
seem to be effective).
Is there a way of getting the names of objects in a .rda file
On 5/11/07, Benilton Carvalho [EMAIL PROTECTED] wrote:
Hi everyone,
sorry if this was discussed before (and in this situation, could you
please point me to the discussion in the archive? My search didn't
seem to be effective).
Is there a way of getting the names of objects in a .rda file
An approach would be to attach it and then use ls()
attach(myarchive.rda)
ls(pos=2)
detach(myarchive.rda)
-Christos
Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830
www.nuverabio.com
-Original Message-
From:
Prof Brian Ripley wrote:
It is not clear to me what you want here.
I just wanted to be able to quickly find the expression in which an
error occurred when it was inside a lengthy function. I now know that
'debug()' can help with this (debug() allows me to easily step through
the function and
On Fri, 11 May 2007, Benilton Carvalho wrote:
Hi everyone,
sorry if this was discussed before (and in this situation, could you
please point me to the discussion in the archive? My search didn't
seem to be effective).
Is there a way of getting the names of objects in a .rda file without
On 5/10/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote:
Paul Johnson wrote:
This is a follow up to the message I posted 3 days ago about how to
estimate mixed ordinal logit models. I hope you don't mind that I am
just pasting in the code and comments from an R file for your
feedback.
Thank you very much for the pointer, Duncan!
BTW, one comment. While testing your suggestion, I found that only 'save'
works (exactly like you said!), not 'save.image' (see the following R
session). 'save.image' only sees .globalEnv. So I guess the
statement--'save.image()' is just a
Christos Hatzis [EMAIL PROTECTED] writes:
An approach would be to attach it and then use ls()
No, that really is not an approach. If you load it, then there is no
problem to read the names. The point is not to load it. This is
important when dealing with large objects or large collections
You're right. I didn't realize that what happens when attaching is that
a new environment is created on the search path and the elements of a list
(including columns of a data frame) or objects in a save file or an
environment are *** copied *** into the new environment
Thanks.
-Christos
Sorry if this is too off-topic, as we may not implement this in R
(although we may do so).
A student of mine is looking at some public opinion data in which there
appears to be a statistically significant difference between levels of
support for a proposal based on which of two question
#Sorry for the convoluted subject line.
#I have:
a=c(1,2,3)
x=a #example of user supplied input
#Is there any function that will tell me the name of the object x refers to,
referring only to x itself?
#i.e. the answer I want is a
#I want:
#fun(x) == 'a'
#(I don't think this is possible,
On Fri, 2007-05-11 at 13:43 -0500, Frank E Harrell Jr wrote:
kseefeld wrote:
Kim’s EZ Recipe for….
SAS TO R, perfectly formatted table with no loss of data
• In SAS: Export SAS DB as access db
• In R go to directory where access db is stored
• Use package RODBC
#R code
Something like this?
R f - function(x) deparse(substitute(x))
R a - 1:3
R f(a)
[1] a
Andy
From: new ruser
#Sorry for the convoluted subject line.
#I have:
a=c(1,2,3)
x=a #example of user supplied input
#Is there any function that will tell me the name of the
object x refers
Hello everyone,
I have some difficulties on controling the margin of a plot.
For example, the following code from the help of maptools:
library(maptools)
xx - readShapePoly(system.file(shapes/sids.shp, package=maptools)[1],
IDvar=FIPSNO, proj4string=CRS(+proj=longlat +ellps=clrk66))
plot(xx,
I'm a newbie, so please forgive me:
I have a data frame that includes two long columns of x and y coordinate
values thusly:
... ... ... x y ... ...
... ... ... 115 127 ... ...
... ... ... 120 129 ... ...
... ... ... 0 0 ... ...
... ... ...
Dear R users;
Is it possible to get the row and column number of a particular entry
in a dist object?
Let's say that I want to find the position of the value 1.1837 (the
last entry on the dist object below), that is [6,3]. Can I get those
values without transforming the object to a matrix?, i.e.
I'm interested in writing some model selection functions (for linear
regression models, as a start), which incorporate the PRESS criterion since
it, to my knowledge, is not currently implemented in any available model
selection procedure.
I thought it would be simplest to build on already
But the dist object is not structured with rows and columns. i.e.
x=1:4
d=dist(x)
1 2 3
2 1
3 2 1
4 3 2 1
str(d)
Class 'dist' atomic [1:6] 1 2 3 1 2 1
..- attr(*, Size)= int 4
..- attr(*, Diag)= logi FALSE
..- attr(*, Upper)= logi FALSE
..- attr(*, method)= chr euclidean
..-
Thanks Francisco;
I'm trying to avoid the step of converting a dist object into a matrix
because I'm working with matrices of more than 5000 rows x 5000
columns. I just was wondering if someone knew any trick to do that.
On 5/11/07, Francisco J. Zagmutt [EMAIL PROTECTED] wrote:
But the dist
I have Windows XP machines with different software configurations.
My laptop has Adobe Reader 8 and Adobe Acrobat 6.
My desktop has Adobe Reader 8 and does not have Adobe Acrobat.
On both machines, PDF extensions are registered to Adobe Reader 8.0,
and double-clicking a pdf file in Windows
Just a guess but perhaps it opens the file with the association that
existed when R was installed and that association was different from
the current association? Try re-installing R and see if that changes it.
On 5/11/07, Richard M. Heiberger [EMAIL PROTECTED] wrote:
I have Windows XP machines
On 11/05/2007 7:37 PM, Richard M. Heiberger wrote:
I have Windows XP machines with different software configurations.
My laptop has Adobe Reader 8 and Adobe Acrobat 6.
My desktop has Adobe Reader 8 and does not have Adobe Acrobat.
On both machines, PDF extensions are registered to Adobe
which(..., arr.ind=TRUE)
On 5/11/07, Pedro Mardones [EMAIL PROTECTED] wrote:
Dear R users;
Is it possible to get the row and column number of a particular entry
in a dist object?
Let's say that I want to find the position of the value 1.1837 (the
last entry on the dist object below), that
On 5/11/07, Pedro Mardones [EMAIL PROTECTED] wrote:
Dear R users;
Is it possible to get the row and column number of a particular entry
in a dist object?
Let's say that I want to find the position of the value 1.1837 (the
last entry on the dist object below), that is [6,3]. Can I get those
Hi, everyone
When I was using cv.lm(DAAG) , I found there might be something wrong with
it. The problem is that we can't use it to deal with a linear model with
more than one predictor variable. But the usage documentation
hasn't informed us about this.
You can find it by excuting the following
Duncan is on the right track.
Thanks.
In the CMD window
start c:\Program Files\R\R-2.5.0\doc\manual\R-admin.pdf
opens another CMD window with the quoted string as title.
In the CMD window
start c:\Progra~1\R\R-2.5.0\doc\manual\R-admin.pdf
(with the 8.3 name and no embedded blanks) opens
This is yet another guess but it might be that its not a matter of whether
its installed or not but whether its running (possibly in the
background). If that
were the case then forcing a new instance might solve it.
Have a look at the last page of the following for the command line switches:
Hi guys,
I've brand new to the R scene.
I have hundreds of csv files that has field 1 ,/MM/DD as index
How to generate a graph of distribution and calculate the standard deviation
of field2 for all of the files in a directory?
I'm wondering if R could do this.
Thanks a lot.
--
View this
64 matches
Mail list logo