At 04:26 8/04/2013, you wrote:
Hello,
I have the following r-codes for solving a quasilikelihood estimating
equation:
>library(geepack)
>fit<-geese(y~x1+x2+x3,jack=TRUE,id=id,scale.fix=TRUE,data=dat,mean.link =
"logit", corstr="independence")
Now my question is how can I calculate the confiden
I recommend the panel function from the HH package
## install.packages("HH") ## if necessary
library(HH)
bwplot(b~x|a,data=DF, panel=panel.bwplot.intermediate.hh,
col = c("darkorange1","limegreen","magenta"))
Rich
On Sun, Apr 7, 2013 at 4:45 PM, Concha Bielza wrote:
> Dear all,
>
>
Hi Concha
You nearly got there try:
set.seed(42)
D1 <- rnorm(200)
D2 <- factor(sample(letters[1:2],200,TRUE))
D3 <- factor(sample(letters[3:5],200,TRUE))
DF <- data.frame(x=D1,a=D2,b=D3)
print(bwplot(b~x|a,data=DF,
par.settings = list(box.dot = list(rep("black",3)),
> I am aware of the apply() functions,
> but they are wrapper function of for loops, so they are slower.
While this sounds right in the abstract, it isn't always so. Many times
looping code is slow not because of the function calls of interest but
because of how the memory used to store the resul
Vectors. Data frames are lists of vectors. Create longer vectors and perform
computations vector-wise on all simulation data sets at once. Depending on the
type of simulation, matrices and linear algebra may help as well.
---
Dear all,
I would like to have the same color for the all boxplots from the same
panel, but my code below shows the two colors alternating. Thanks!
set.seed(42)
D1 <- rnorm(200)
D2 <- factor(sample(letters[1:2],200,TRUE))
D3 <- factor(sample(letters[3:5],200,TRUE))
DF <- data.frame(x=D1,a=D2,b
On Apr 7, 2013, at 16:06 , Mike Amato wrote:
> Thanks for the reply. Maybe my problem is that prcomp() and varimax()
> are calculating "cumulative proportion of variance" differently?
> When I use the tol parameter with prcomp(), it restricts the number of
> components to 3 and reports that the
May I say also ask one thing? @OP: sorry to use your post.
What would you use instead of loops? I am aware of the apply() functions,
but they are wrapper function of for loops, so they are slower. At one
point, I was told to go back to C for faster implementation, but I like R
much more.
In th
PLEASE, please ... learn to use R's Help system before posting here!
within R:
>??"discriminant analysis"
## short form of: help.search("discriminant analysis")
?help
?help.search
or even google something like:
"R software discriminant analysis"
Cheers,
Bert
On Sun, Apr 7, 2013 at 11:25 A
Use lag.xts:
R> lag(x,-1)
aaabbb cccddd
2001-01-02 181.1751 243.24 1689.10 267.15
2001-01-03 181.6126 242.09 1737.86 267.10
2001-01-04 NA NA NA NA
Note that the sign of k is different for lag.xts than lag.zoo (and lag.default).
R> lag(as.zoo(x),-1)
Hi,
Try this:
Mult3$mode.ids
#[1] 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1
#Levels: 1 2 3 4 5 6
I guess the key is to have equal number of alternatives.
Mult3$mode.ids<- as.numeric(as.character(Mult3$mode.ids))
res<-mlogit.data(Mult3[-25,],shape="long",choice="CHOICE",alt.var="mode.id
i have an xts object:
aaa bbbccc ddd
2001-01-02 179.7061239.11 1712.60 271.10
2001-01-03 181.1751243.24 1689.10 267.15
2001-01-04 181.6126242.09 1737.86 267.10
i
Hello.
I've got many (5-20k) files with time series in a text format like this:
1359635460 2.006747
1359635520 1.886745
1359635580 3.066988
1359635640 3.633578
1359635700 2.140082
1359635760 2.033564
1359635820 1.980123
1359635880 2.060131
1359635940 2
Thanks for the reply. Maybe my problem is that prcomp() and varimax()
are calculating "cumulative proportion of variance" differently?
When I use the tol parameter with prcomp(), it restricts the number of
components to 3 and reports that the cumulative variance explained by
the third component
Hi,
if I have a data such that,
type otu1 otu2 otu3 otu4 otu5
sampleA A1 23 4 56
sampleA A2 14 9 32
sampleB B1 36 1 45
sampleB B2 45 3 43
I want to make a heatmap that A1 and A2 are clusted in sampleA and B1 and B2
a
Hi,
DATA[DATA$A!="Blue1",]
# A B C D
#1 Red1 1 1 1
#3 Red2 1 1 1
#4 Red3 1 1 1
#or
DATA[!grepl("Blue1",DATA$A),]
# A B C D
#1 Red1 1 1 1
#3 Red2 1 1 1
#4 Red3 1 1 1
A.K.
- Original Message -
From: Beatriz González Domínguez
To: r-help@r-project.org; R Help
Cc:
Sent: Sunday, A
Dear all,
Could anyone help me with the following?
DATA <- data.frame(rbind(c("Red1", 1, 1, 1), c("Blue1", 1, 1, 1), c("Red2", 1,
1, 1), c("Red3", 1, 1, 1)))
colnames(DATA) <- c("A", "B","C", "D")
#Option 1
DATA <- DATA[-2, ] #Same result I would like to achieve with Option 2
#Option 2 - I wou
Hello,
I have the following r-codes for solving a quasilikelihood estimating
equation:
>library(geepack)
>fit<-geese(y~x1+x2+x3,jack=TRUE,id=id,scale.fix=TRUE,data=dat,mean.link =
"logit", corstr="independence")
Now my question is how can I calculate the confidence interval of the
parameters of
I have the Rexcel package. Which of the functions do I want to run a
discriminant function analysis? Or, how would I do it in R?
Thanks.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/list
> seems like not possible without X windows onthat putty from
> windows box
Certainly if you want to run R under X windows you will need to run an X server
on Windows, typically on top of PuTTY
But once you have X running and connected in Windows, just start R from the
command line. That's how
On Apr 6, 2013, at 10:08 PM, Katherine Gobin wrote:
Dear Sir,
I am referring to your package "FAdist". I wish to know how to
estimate the parameters of the distribution - "Log-Pearson Type III
Distribution"?
I suppose I could look up the maintainer of that package and try to
see if the
On Apr 6, 2013, at 8:58 PM, Katherine Gobin wrote:
Dear R forum
(2) Is there any other R forum dealing with only Statistical queries?
The website named Crossvalidated , http://stats.stackexchange.com/questions/
, is designed for purely statistical questions although it cannot be
conside
Hello,
I have the following r-codes for solving a quasilikelihood estimating
equation:
>library(geepack)
>fit<-geese(y~x1+x2+x3,jack=TRUE,scale.fix=TRUE,data=dat,mean.link =
"logit", corstr="independence")
Now my question is how can I calculate the confidence interval of the
parameters of the ab
>> I have a data file 'stop' to be scanned in
>> R.
>> But I want to ignore one specific number '21' there. Putting differently,
>> I
>> want to get all numbers in the file except 21. Is there any command to
>> achieve it?
>>
See the na.strings argument to scan, and note that it can be a vecto
Hi,
Try:
year1<- 1598:1997
indx<-findInterval(year1,seq(1591,2000,by=10))
group<-seq(1590,2000,by=10)
ind<-seq(1,length(group),by=1)
labl1<-paste(group[ind],group[ind+1],sep="-")[-42]
dat1<- data.frame(year=year1,decade=labl1[indx],stringsAsFactors=FALSE)
head(dat1,5)
# year decade
#1 1598 1
HI Graham,
Try this:
lst1<-split(Mult3,Mult3$obs)
Mult3New<-do.call(rbind,lst1[lapply(lst1,nrow)==6]) # YOu can change 6 to
other numbers
res1<-
mlogit.data(Mult3New,shape="long",choice="CHOICE",alt.var="mode.ids",indivs="set3",chid.vars="obs")
head(res1,2)
# dn obs choice br mth tcomp num
On 07.04.2013 09:53, Eva Prieto Castro wrote:
Hi Uwe,
Thank you for your help. Then, how can I know (in runtime) then max
width and height I can use?. If it depends on the screen inches, I
should obtain those values in runtime, is this true?.
The appearance in graphic window must be vertical
Hello,
You should say from what package are the functions you're using.
From the help page of createFolds, the return value is "A list or
matrix of row position integers corresponding to the training data"
So to subset use `[` or `[[`. Try
class(folds$index$Fold_i)
If it's a numeric vector,
Anyone?
;-)
2013/4/7 Nicolás Sánchez
> Hello!
>
> I have a question. I am working with createFolds:
>
> folds<- trainControl(method='cv', index=createFolds(data$Score,list =
> TRUE))
>
> I need to iterate over folds to extract the indexes from each fold.
>
> For example, if I do folds$index$Fo
Dear List
I am trying to fit a multinomial model using the mlogit package. Attempting to
load
the data into mlogit presents the following error.
MLOG<-mlogit.data(Mult3,shape="long",choice="CHOICE",alt.var="mode.ids",indivs
= "set3",chid.var = "obs")
Error in `row.names<-.data.frame`(`*tmp*`, v
Hello,
What is the output of str(pg)? Is pg a data.frame?
Rui Barradas
Em 07-04-2013 14:14, catalin roibu escreveu:
Dear all!
I have a problem when I use this equation with R.
mpr <- 843.75*exp(-1.119*pg)
Error in FUN(left, right) : non-numeric argument to binary operator
pg
01 02 03 04
Dear all!
I have a problem when I use this equation with R.
mpr <- 843.75*exp(-1.119*pg)
Error in FUN(left, right) : non-numeric argument to binary operator
pg
01 02 03 04 05 06 07 08 09-236 10-63T 11 12 13 14 15 16 17-234 18 19 20
23
1592 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA N
Hello!
I have a question. I am working with createFolds:
folds<- trainControl(method='cv', index=createFolds(data$Score,list = TRUE))
I need to iterate over folds to extract the indexes from each fold.
For example, if I do folds$index$Fold01, it contains:
5 11 17 29 44 50 52 64 65
I nee
Of Course, that's the solution!
Thankss!
2013/4/6 Rui Barradas
> Hello,
>
> Can't you simply call svm() with scale = FALSE ?
> If the variable is constant, it cannot be scaled to unit variance (and
> zero mean).
>
> Hope this helps,
>
> Rui Barradas
>
> Em 06-04-2013 17:19, Nicolás Sánchez escr
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Loops are seldom a good solution in R so some more information and data would
be useful
At the simplist, for your specific question I think you could set up two
vectors (e.g. v1 <- rep(NA, 10 ) and just w
>
> My concern is with the reported proportions of variance for the 3
> components after varimax rotation. It looks like each of my 3 components
> explains 1/15 of the total variance, summing to a cumulative proportion
> of 20% of variance explained. But those 3 components I retained should
>
On 12-11-01 4:14 AM, Jan van der Laan wrote:
I have a r-script (rook.R) that starts a Rook server. To present users
from having to start R and type in source("rook.R"), I want to create
a bash script and bat file that starts R and sources the script.
However, to keep the Rook server running R sh
Hi Uwe,
Thank you for your help. Then, how can I know (in runtime) then max width and
height I can use?. If it depends on the screen inches, I should obtain those
values in runtime, is this true?.
The appearance in graphic window must be vertical (as A4 paper or something
like that), apart fr
another working Example:
{ echo "print( 1)"; cat;} | R --interactive
but do not end with -D, it overrides the
"save workspace" question; use q() instead
there is an additional echo where i don't know
how to avoid them
On Thu, Nov 01, 2012 at 09:14:09AM +0100, Jan van der Laan wrote:
>
> I ha
one way could be:
$ cat rook.R | R --interactive
but with a little different console behaviour
the problem in your other examples is, that
R uses only the first appearing switch of:
--interactive, --f, -e, --vanilla, --no-save, ...
the switches cannot be combined
On Thu, Nov 01, 2012 at 09:14
Hi
some functions, like plot, readline and others behave
different depending to the result of the function interactive()
there is no way to ask R which functions do that
On Thu, Sep 06, 2012 at 01:22:32PM -0500, Michael wrote:
> Help! Weird behavioral difference between R interactive and comman
I already know this, I did a second post, where I mention this, but I
have still problems with the implementation, especially in case of
other distributions! But thanks for your answer.
2013/4/7 Patrick Burns :
> There is an example of using the t distribution
> for VaR in:
>
> http://www.portfoli
Hi Bill,
Thank you for your suggestion.
I shall try running the code and test as you suggest.
Is there a straightforward way to routinely test the structure of a complex
survey data set such as this?
For example with a multinomial choice model such as this for the data to be
correct for each
brs <- seq(1590,2000,by=10)
lbs <- paste(brs[-length(brs)],brs[-1],sep="-")
y <- cut(x,breaks=brs,labels=lbs) # Where "x" is your data vector.
grpd <- data.frame(year=x,decade=y)
head(grpd)
yeardecade
1 1598 1590-1600
2 1599 1590-1600
3 1600 1590-1600
4 1601 1600-1610
5 1602 1600-1610
6 16
There is an example of using the t distribution
for VaR in:
http://www.portfolioprobe.com/2012/11/19/the-estimation-of-value-at-risk-and-expected-shortfall/
The trick is to know what the variance of the
distribution is for a given value of the degrees
of freedom.
Pat
On 06/04/2013 10:54, Stat
Hello all!
I have a problem to group my data (years) in 10 years classes. For example
for year
year decade
1598 1590-1600
1599 1590-1600
1600 1590-1600
1601 1600-1610
---
my is like this>
[1] 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
1612
[16] 1613 1614 1615
Ok,
I try it again with plain text, with a simple R code example and just
sending it to the r list and you move it to sig finance if it is
necessary.
I try to be as detailed as possible.
I want to fit a distribution to my financial data using a volatility
model to estimate the VaR. So in case of
package -ADGotTest
it demends known distribution function
thank you
--
View this message in context:
http://r.789695.n4.nabble.com/ad-test-parameters-tp4663500p4663578.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project
i have one set of data and i want to make AD test to see if the data fits my
distribution function (this function unknown by R but i have the formula for
f(x) and F(x))
--
View this message in context:
http://r.789695.n4.nabble.com/ad-test-parameters-tp4663500p4663579.html
Sent from the R help
Hi,
I am new at R and still trying to get the hang of things.
I am running a while loop and wish to save the results of each iteration.
The results are a vector x of length two and I wish to save the results of
each iteration as two vectors, one for x[1] and the other for x[2].
Thanks!
[[
50 matches
Mail list logo