On Wed, 29 Jun 2005, David Duffy wrote:
I couldn't resist adding a more literal answer
This can only work for escapes which are preserved. The parser maps
\n to a character (LF) and the deparser maps it back to \n.
This happens to be true of \a \b \f \n \r \t \v \\ but no others.
For example,
There are several packages within rmetrics such as fSeries, fBasics,
fExtremes, and so on.
You can download those in the usual way.
From: Spencer Graves [EMAIL PROTECTED]
To: ronggui [EMAIL PROTECTED]
CC: R [EMAIL PROTECTED]
Subject: Re: [R] where can i download the metrics package?
Date: Tue,
Here is a way: it uses 'paste' but I dont think it is a problem anyway
to use it.
Nevertheless, it is surely a bad idea to fit any model with more than
25 terms...
main_effects = paste(nam,collapse=+)
inter - outer(nam,nam,paste,sep=:)
inter -
Try also ?sphpca (library(psy) -- new version 0.7)
Best
Bruno
Bruno Falissard
INSERM U669, PSIGIAM
Paris Sud Innovation Group in Adolescent Mental Health
Maison de Solenn
97 Boulevard de Port Royal
75679 Paris cedex 14,
On Tue, 28 Jun 2005, Luke wrote:
Dear R users,
I have a data with 1000 variables named x1, x2, ..., x1000, and
I want to construct a formula like this format:
~x1+x2+...+x1000+x1:x2+x1:x3+x999:x1000+log(x1)+...+log(x1000)
That is: the base variables followed by all interaction terms and
Karen == Karen Kotschy [EMAIL PROTECTED]
on Tue, 28 Jun 2005 13:13:31 +0200 writes:
Karen Dear R list Would anyone be able to tell me whether
Karen it is possible to do enhanced multidimensional
Karen scaling (enhanced MDS) in R? In other words,
Karen something that goes
Dear R Users,
Could somebody please compare the packages of unit root test ( Uroot, Ucra,
tseries and fseries ) regarding the type of test ( without constant and trend,
with constant , and with constant and trend ) ?
Regards,
Amir Safari
Dear David, Dear Friends,
After any running svm I receive different results of Error estimation of 'svm'
using 10-fold cross validation. What is the reason ? It is caused by the
algorithm, libsvm , e1071 or something els? Which value can be optimal one ?
How much run can reach to the
On Wed, 29 Jun 2005 03:08:23 -0700 (PDT) Amir Safari wrote:
Dear R Users,
Could somebody please compare the packages of unit root test ( Uroot,
Ucra, tseries and fseries ) regarding the type of test ( without
constant and trend, with constant , and with constant and trend ) ?
IMHO,
Amir Safari wrote:
Dear David, Dear Friends,
After any running svm I receive different results of Error estimation of
'svm' using 10-fold cross validation. What is the reason ? It is caused by
the algorithm, libsvm , e1071 or something els? Which value can be optimal
one ? How much
[EMAIL PROTECTED] wrote:
Dear All,
I've a question about scaling the input variables for an analysis with
svm (package e1071). Most of my variables are factors with 4 to 6
levels but there are also some numeric variables.
I'm not familiar with the math behind svms, so my assumtions maybe
Dear David, Dear Friends,
After any running svm I receive different results of Error estimation
of 'svm' using 10-fold cross validation.
using tune.svm(), or the `cross' parameter of svm()?
What is the reason ? It is caused by the algorithm, libsvm , e1071 or
something els?
The
Dear Group
I'm still trying to bring many data into R (see older postings). After solving
some troubles with the database I do most of the work in MySQL. But still I
could be nice to work on some data using R. Therefore I can use a dedicated
Server with Gentoo Linux as OS hosting only R. This
Hello and apologies for a very long question. I thought it better to be
verbose and clear than short and imprecise. I am trying to compute the brier
score comparing true surv object of test data to predictions from train data
(using sbrier in ipred package). I am having trouble getting the right
Hello!
Does someone know how to produce
L(y|mu)
with plotmath?
Some code with unsuccessfull results:
plot(dnorm(x = seq(from = -4, to = 4, by = 0.1)), type = l)
## Not what I want
legend(legend = c(expression(L(y:mu))), x = topright)
## Strange, is this a bug?
legend(legend
Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look at this:
f1 - function(x){x*x*x*x*x*x*x*x}
f2 - function(x){x^8}
f3 -
Something like this is exploited very nicely in the mtx.exp
for matrix powers in the Malmig package, actually.
Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit
I tried your code and got different results:
system.time(ignore - f1(a))
[1] 0.83 0.09 1.08 NA NA
system.time(ignore - f2(a))
[1] 0.38 0.01 0.41 NA NA
system.time(ignore - f3(a))
[1] 0.32 0.04 0.43 NA NA
So I tried it again but with a
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look at this:
f1 -
Hi,
I've written this function:
g = function(test,p1,p2)
{
test=sort(test)
merke=0
for (z in 1:length(test))
{
F1=((2*z-1)/length(test))
F21=log(plnorm(test[z],p1,p2))
F22=log(1-plnorm(test[length(test)+1-z],p1,p2))
F2= F21+F22
merke=merke+F1*F2
}
return(-length(test)*-merke)
}
Let's assume this is a 32-bit Xeon and a 32-bit OS (there are
64-bit-capable Xeons). Then a user process like R gets a 4GB address
space, 1GB of which is reserved for the kernel. So R has a 3GB address
space, and it is trying to allocate a 2GB contigous chunk. Because of
memory
Hi Duncan
On Jun 29, 2005, at 02:04 pm, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small
powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using
On Wed, 29 Jun 2005, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
I have been wondering if there one can speed up calculating small powers
of numbers such as x^8 using multiplication.
In addition, one can be a bit clever and calculate x^8 using only 3
multiplies.
look
On 6/29/2005 9:31 AM, Robin Hankin wrote:
Hi Duncan
On Jun 29, 2005, at 02:04 pm, Duncan Murdoch wrote:
On 6/29/2005 7:32 AM, Robin Hankin wrote:
Hi
I have been wondering if there one can speed up calculating small
powers
of numbers such as x^8 using multiplication.
In addition,
Hi,
I suddenly started getting strange errors while working on my caTools
package:
RCMD install C:/programs/R/rw2011/src/library/caTools
..
preparing package caTools for lazy loading
Error in file(file, r, encoding = encoding) :
all connections are
On 6/29/05, Tuszynski, Jaroslaw W. [EMAIL PROTECTED] wrote:
Hi,
I suddenly started getting strange errors while working on my caTools
package:
RCMD install C:/programs/R/rw2011/src/library/caTools
..
preparing package caTools for lazy loading
Error in
On Jun 29, 2005, at 02:47 pm, Duncan Murdoch wrote:
On 6/29/2005 9:31 AM, Robin Hankin wrote:
Hi Duncan
library(gsl)
system.time(ignore - pow_int(a,8))
[1] 1.07 1.11 3.08 0.00 0.00
why the slow execution time?
Shouldn't you ask the gsl maintainer that? :-)
well I did ask myself,
Hello,
R gives us the correlation functions cor(). (Many thanks ;-))
Does it also exist a moving correlation coefficient ?
(like the moving average).
If not, could someone give me some infos or link
on how to practically implement such a function in R.
(I did search for moving correlation on the
vincent wrote:
Hello,
R gives us the correlation functions cor(). (Many thanks ;-))
Does it also exist a moving correlation coefficient ?
(like the moving average).
If not, could someone give me some infos or link
on how to practically implement such a function in R.
(I did search for
I found the problem, by doing comparison of directories and files of
working and not working versions, and applying changes one by one until one
caused install to fail. It was a case of having a call to a source
function somewhere in my code, that I forgot about.
I was definitely doing
I ran 100 repetitions of the 3 multiplications that Robin had compared.
Here are the summaries of system times (I only took the first component of
system.time) that I obtained. It is clear that f1() is nearly twice as slow
as f2() which is slightly slower (not 3 times slower as claimed by Robin)
In general, the Russian peasant algorithm, which requires only O(log
n) multiplications, is very good. Section 4.6.3 of Knuth's The Art of
Computer Programming. Volume 2: Seminumerical Algorithms has an in depth
discussion.
I have had to use this in the past, when computers were slower and
Hi and sorry to disturb,
I'll try to be as clear as possible:
I want to select rows of a data frame called Data2.Iso regarding the
frequency of a factor variable called Variete that I want =4.
I used function table to have the frequency:
FRAMEVARIETE-as.data.frame(table(Data2.Iso$Variete))
or ?rapply in package zoo.
spencer graves
Sundar Dorai-Raj wrote:
vincent wrote:
Hello,
R gives us the correlation functions cor(). (Many thanks ;-))
Does it also exist a moving correlation coefficient ?
(like the moving average).
If not, could someone give me some infos or link
See if this does what you want:
dat - data.frame(f=factor(sample(letters[1:10], 100, replace=TRUE)),
x=runif(100))
str(dat)
`data.frame': 100 obs. of 2 variables:
$ f: Factor w/ 10 levels a,b,c,d,..: 2 5 10 9 10 3 9 8 3 1 ...
$ x: num 0.9162 0.0481 0.3048 0.0938 0.8599 ...
g -
Hello,
I tried to fit a lognormal distribution by using optim. But sadly the output
seems to be incorrect.
Who can tell me where the bug is?
test = rlnorm(100,5,3)
logL= function(parm, x,...) -sum(log(dlnorm(x,parm,...)))
start= list(meanlog=5, sdlog=3)
Looking at the code for gsl_pow_int, I see they do use that method.
David L. Reiner
-Original Message-
From: [EMAIL PROTECTED] [mailto:r-help-
[EMAIL PROTECTED] On Behalf Of David Reiner
[EMAIL PROTECTED]
Sent: Wednesday, June 29, 2005 9:50 AM
To: r-help
Subject: Re: [R]
Carsten Steinhoff wrote:
Hello,
I tried to fit a lognormal distribution by using optim. But sadly the output
seems to be incorrect.
Who can tell me where the bug is?
test = rlnorm(100,5,3)
logL= function(parm, x,...) -sum(log(dlnorm(x,parm,...)))
start=
the following work for me:
x - rlnorm(1000, 5, 3)
fn - function(parms, dat) -sum(dlnorm(dat, parms[1], parms[2], log =
TRUE))
optim(c(5, 3), fn, dat = x)
library(MASS)
fitdistr(x, log-normal, list(meanlog = 5, sdlog = 3))
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D.
Thank you for your answers.
In fact, i believe my question wasn't precise enough.
I don't want to have a moving/sliding windows over the data
to correlate (i am already doing that).
If I have 2 vectors
X = (x1, x2, x3, ..., xt)
Y = (y1, y2, x3, ..., yt)
I want the most recent elements (t) to
Dear all,
I am using poly() in lm() in the following form.
1 DelsDPWOS.lm3 - lm(DelsPDWOS[,1] ~ poly(DelsPDWOS[,4],3))
2 DelsDPWOS.I.lm3 - lm(DelsPDWOS[,1] ~ poly(I(DelsPDWOS[,4]),3))
3 DelsDPWOS.2.lm3 -
lm(DelsPDWOS[,1]~DelsPDWOS[,4]+I(DelsPDWOS[,4]^2)+I(DelsPDWOS[,4]^3))
1 and 2 lead to
On Wed, 2005-06-29 at 18:19 +0200, Andreas Neumann wrote:
Dear all,
I am using poly() in lm() in the following form.
1 DelsDPWOS.lm3 - lm(DelsPDWOS[,1] ~ poly(DelsPDWOS[,4],3))
2 DelsDPWOS.I.lm3 - lm(DelsPDWOS[,1] ~ poly(I(DelsPDWOS[,4]),3))
3 DelsDPWOS.2.lm3 -
vincent wrote:
Thank you for your answers.
In fact, i believe my question wasn't precise enough.
I don't want to have a moving/sliding windows over the data
to correlate (i am already doing that).
If I have 2 vectors
X = (x1, x2, x3, ..., xt)
Y = (y1, y2, x3, ..., yt)
I want the most
One common weighting scheme is exponentially weighted, i.e., wt =
L^(0:m) ,
where 0 L = 1 .
David L. Reiner
p.s.
If your question is coming from a financial application, you might be
interested in the R-sig-finance list, as well as reading the RiskMetrics
(r)
document Return to RiskMetrics:
Hello all,
I'm using R version 2.0.1. I have been having trouble with my linear
modeling. I have a table that looks something like this:
T RSS DSS LSPFCOLS PS
R RTT Actual Max COMM
char 5 MSS 2
I was surprised to find that I was wrong about powers of complexes:
seq.pow1 - function(x,n) {
+ y - rep(x,n)
+ for(i in 2:n) y[i] - y[i-1] * x
+ y
+ }
seq.pow2 - function(x,n) x^(1:n)
x - 1.001 + 1i * 0.999
# several reps of the following
system.time(ignore -
Hello!
I am trying to fit a Generalized Linear Mixed Model, ordinally I use
GLIMMIX macros in SAS System, but I would like to fit this kind of models
in R.
Could anyone help me on what package I should use to?
Thanks in advance
Francisco
[[alternative HTML version deleted]]
submit the following in R:
RSiteSearch('glmm',restr='functions')
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
The business of the statistician is to catalyze the scientific learning
process. - George E. P. Box
-Original Message-
From: [EMAIL
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: 29 June 2005 18:05
To: r-help@stat.math.ethz.ch
Subject: [R] Generalized Linear Mixed Models
Hello!
I am trying to fit a Generalized Linear Mixed Model, ordinally I use
A-c(1,2,NA,7,5)
B-c(3,4,1,4,1)
C-c(6,5,6,NA,9)
D-c(8,7,4,6,2)
df1-cbind(A,B,C,D)
for(i in seq(1,ncol(df1)-1, by=2)) {
ifelse(df1[,i]==NA,df1[,i+1]==NA,df1[,] ) }
Tried several variations but none worked. I wish to find any NA's in
column's 1 or 3 and change the numerical value to the
You need to use is.na(df1[,i]) to test for NA.
Andy
From: [EMAIL PROTECTED]
A-c(1,2,NA,7,5)
B-c(3,4,1,4,1)
C-c(6,5,6,NA,9)
D-c(8,7,4,6,2)
df1-cbind(A,B,C,D)
for(i in seq(1,ncol(df1)-1, by=2)) {
ifelse(df1[,i]==NA,df1[,i+1]==NA,df1[,] ) }
Tried several variations but
[EMAIL PROTECTED] wrote:
A-c(1,2,NA,7,5)
B-c(3,4,1,4,1)
C-c(6,5,6,NA,9)
D-c(8,7,4,6,2)
df1-cbind(A,B,C,D)
for(i in seq(1,ncol(df1)-1, by=2)) {
ifelse(df1[,i]==NA,df1[,i+1]==NA,df1[,] ) }
Tried several variations but none worked. I wish to find any NA's in
column's 1 or 3
Hi there,
I have a predictor varible class which is a categorical variable and
a ' coxph' is used to find the coeffients. How can I plot the predicted
survival proportion based on this model?
Thanks
Lisa Wang
Princess Margaret Hospital
Toronto
tel 416 946 4501
I am planning to plot my data on log scale (y-axis). There is a
parameter in plot function, which is
plot( ..., log=y, ...)
While, the problem is that it is with base of e. Is there a way to let
me change it to 10 instead of e?
Thanks
__
Here is a way to do it without a loop that could save some time for a big
dataset.
df1
A B C D
[1,] 1 3 6 8
[2,] 2 4 5 7
[3,] NA 1 6 4
[4,] 7 4 NA 6
[5,] 5 1 9 2
df2-cbind(0,ifelse(is.na(df1),NA,0))[,-ncol(df1)-1]
df2
A B C
[1,] 0 0 0 0
[2,] 0 0 0 0
[3,] 0 NA 0 0
Hello
I've decided to try and distill an earlier rather ill focused question to
try and elicit a response. Any help is greatly appreciated. Why does mod.cox
not work with sbrier whilst mod.km does? Can I make it work?
data(DLBCL)
DLBCL.surv-Surv(DLBCL$time,DLBCL$cens)
Is this sbrier from package ipred?
The short answer is that it contains
ptype - class(pred)
and assumes that is of length one. For a survfit.coxph fit it is of class
c(survfit.cox, survfit). I suspect from the help page that this is
not supported, but you need to contact the authors (as
Thank You, Prof. Ripley!
Both test1.R and test2.R worked for me just now, as did the
following minor modification:
(x - readLines(stdin(), n=1))
D:\spencerg\dataPOWER\stats\Tukey\Boxplot_missing_Tukey2.txt
Thanks again.
spencer graves
Prof Brian Ripley wrote:
One other comment. Ninotech Path Copy, which can be found at:
http://home.worldonline.dk/ninotech/
is a free Windows utility that appears in the Windows Explorer context
menu (i.e. it appears as the Copy Path menu entry when you right click
any file in Windows Explorer). I had forgotten
Note that if you want to source it rather than than run it as a batch
job from the command line you will something like this. The way
it works is that one puts the file name into comments that are
marked with tags and the script rereads itself as data picking out
the tagged lines and removing
Hi,
Does anyone know how to extract fixed effects SE values from generalized linear
mixed models estimated using the lmer function in the lme4 library? I searched
attributes and structure with no luck.
Thanks
Frank A. La Sorte, Ph.D.
Department of Fisheries and Wildlife Sciences
I forgot to cc: the list on this reply.
-- Forwarded message --
From: Douglas Bates [EMAIL PROTECTED]
Date: Jun 29, 2005 6:28 PM
Subject: Re: [R] Extract fixed effects SE from lmer
To: La Sorte, Frank A. [EMAIL PROTECTED]
On 6/29/05, La Sorte, Frank A. [EMAIL PROTECTED] wrote:
Hi,
I am wondering if anyone here used deal package in R to do the
bayesian network. I am curious about its scalability: how many
variables and how many observations can it handle in a reasonable
time. If you have some good experience, please share your data
configurations.
thanks,
--
Weiwei
Hi, I am trying to find out a collinearity in
explanatory variables with alias().
I creat a dataframe:
dat - ds[,sapply(ds,nlevels)=2]
dat$Y - Response
Explanatory variables are factor and response is
continuous random variable. When I run a regression, I
have the following error:
fit - aov(
Hi,
Young Cho wrote:
fit - aov( Y ~ . , data = dat)
Error in contrasts-(`*tmp*`, value =
contr.treatment) :
contrasts can be applied only to factors with
2 or more levels
I think there is a dependency in explanatory
variables. So, I wanted to use alias to find out a
dependency
At 01:45 PM 30/06/2005, Young Cho wrote:
Hi, I am trying to find out a collinearity in
explanatory variables with alias().
I creat a dataframe:
dat - ds[,sapply(ds,nlevels)=2]
dat$Y - Response
Explanatory variables are factor and response is
continuous random variable. When I run a regression,
I use R to generate data and I need to estimate the data by egarch (that
doesn't have in R). So how I can call egarch from SAS in R.
Regards,
luck
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Sundar Dorai-Raj a écrit :
Perhaps ?cov.wt will work for you? Your example would be identical to:
set.seed(1)
X - rnorm(100); Y - rnorm(100)
# using cov.wt
rho1 - cov.wt(cbind(X, Y), 1:100, cor = TRUE)$cor[1, 2]
# your weighting scheme
rho2 - cor(X[rep(1:100, 1:100)], Y[rep(1:100,
Hi,
Can someone tell me if it is possible to set the dispersion parameter constant
when fitting a negative binomial glm in R? I've looked at the documentation and
can't find the appropriate argument to pass.
In STATA I can type: nbreg depvar [indepvar...], offset(offset)
dispersion(constant).
69 matches
Mail list logo