On 11/01/2013 01:59, Alphan Kirayoglu wrote:
Hi,
Is there a function to calculate probabilities for new out-of-sample data
once we fit a model using the in-sample data?
predict(model, newdata=... ) seems to require the new data to be the same
size as the original data used to fit the model.
I
?which.max
On Fri, Jan 11, 2013 at 7:59 AM, ej wrote:
> apply(m, 1, max)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide comment
Thanks a lot
it works!
2013/1/11 Rui Barradas :
> Hello,
>
> Here are two ways.
>
> dat <- read.table(text = "
>
> id1id2 value
> 2353 2353 0.096313
> 2353 2409 0.301773
> [...etc...]
>
> 2356 2356 0
> 2356 2611 0
> 2611 2611 0
> ", header = TRUE)
>
> mat1 <- matrix
Dear R users:
I have been trying to figure out how to include string variables in a for
loop to run multiple random forests with little success. The current code
returns the following error:
Error in trafo(data = data, numeric_trafo = numeric_trafo, factor_trafo =
factor_trafo, :
data class c
Hi,
Is there a function to calculate probabilities for new out-of-sample data
once we fit a model using the in-sample data?
predict(model, newdata=... ) seems to require the new data to be the same
size as the original data used to fit the model.
In short, I would like to fit a model and then pa
So, I am just trying to learn R...
Here is a rather contrived example that would be pretty obvious to me in
terms of writing code to loop through elements, but the slick, fast, compact
way of expressing this in R is not obvious to me.
Here's code to generate a simple matrix of data:
> m <- floor
On 13-01-10 4:54 PM, michele caseposta wrote:
Hi everybody,
thanks for the replies.
I might have not explained the problem completely.
Duncan Mackay:
Yes, I am already having a master file and separate Rnw files.
Duncan Murdock:
I am using patchDVI in the TexShop Sweave engine.
Sync works flawles
Dear R users,
I wish to manually demean a panel over time and entities. I tried to code
the Wansbeek and Kapteyn (1989) transformation (from Baltagi's book Ch. 9).
As a benchmark I use both the pmodel.response() and model.matrix() functions
in package plm and the results from using dummy variable
Dear R People:
Is there a way to just print the commands without output into R2HTML, please?
What I would like to do is to put up some commands for the students
and see if they can get results.
Thanks,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
U
Some while ago I posted a problem on this list concerning a failure of
R CMD check on one of my packages that resulted from LaTeX being
unable to find the "inconsolata" font. This was under the Ubuntu OS.
This was solved, thanks to advice I got from this list, basically by
doing
sudo apt-g
Thank you Mr Snow. I will look into it.
Best regards
Joyce Lin
On 11 Jan, 2013, at 3:55 AM, Greg Snow <538...@gmail.com> wrote:
> To further the understanding of the loess fit and how the tricube weight work
> you may want to look at the loess.demo function in the TeachingDemos package.
> I
On Jan 10, 2013, at 1:29 PM, Robert Pazur wrote:
> Dear all,
> i would like to plot each value from my datasets as segment with defined
> transparency
> However, I didnt find out how to set the transparency.
> definition by "col=" in par() or segments() doesnt seem to work
> any suggestions?
Try
On Jan 10, 2013, at 12:04 PM, Greg Snow wrote:
> I believe the problem could be that xyplot uses grid graphics and plot.new
> and curve are base graphics functions and the 2 graphics systems (grid and
> base) don't play nicely together without a little extra work. In general
> the gridBase packa
Hello,
You can use ?rgb to set the transparency level. As an example, with
alpha = 0.5
clr <- c(rgb(1, 0, 0, 0.5), rgb(0, 0, 1, 0.5))
plot(0:1, 0:1, col = clr[1], lwd = 10, type = "l")
lines(0:1, 1:0, col = clr[2], lwd = 10)
Hope this helps,
Rui Barradas
Em 10-01-2013 21:29, Robert Pazur es
Instead of reinventing the wheel, why not use the "segmented" package?
Having stored your data in a data frame "X" I did:
require(segmented)
m1 <- lm(FM ~ BMIJS,data=X)
m2 <- segmented(m1,seg.Z=~BMIJS,psi=list(BMIJS=35))
which worked instantaneously. The break point is estimated as 41.580, wi
Dear R users,
my question concerns my interest in comparing the beta coefficients between
two identical regression models in two (actually 3) groups. Disclaimer: I am
quite new to R, so I might be missing some terminology that I have not come
across.
I am trying to find out if I can
HI Eliza,
You could do this:
set.seed(15)
mat1<-matrix(sample(1:800,124*12,replace=TRUE),nrow=12) # smaller dataset
#Your codes
list1<-list()
for(i in 1:ncol(mat1)){
list1[[i]]<-t(apply(mat1,1,function(x) x[i]-x))
list1}
x<-list1
x<-matrix(unlist(x),nrow=12)
x<-abs(x)
y<-colSums(x, na.r
RSiteSearch("lambert")
I don't know anything about OpenBUGS, but implementations of the Lambert W
function exist, or you could roll your own.
---
Jeff NewmillerThe . . Go Live...
DCN:
I know that rpart has a complexity parameter that adjusts the number of nodes
in a model. I also know that a loss function allows one to weight
misclassifications of different types. However, some of my predictor variables
are much more expensive dollar-wise to use than others. Is there a way to
Hi everybody,
thanks for the replies.
I might have not explained the problem completely.
Duncan Mackay:
Yes, I am already having a master file and separate Rnw files.
Duncan Murdock:
I am using patchDVI in the TexShop Sweave engine.
Sync works flawlessly between the master file and the pdf produce
mat[match(ind, mat[, 2]), ]
[,1] [,2]
[1,] "y" "c"
[2,] "x" "b"
[3,] "z" "d"
[4,] "w" "a"
though you need to take care if you have cases where ind will contains letters
that are not in mat[, 2] and so on (check ?match).
Best,
I
On 10 Jan 2013, at 18:21, array chip wrote:
> Hi I h
Dear all,
i would like to plot each value from my datasets as segment with defined
transparency
However, I didnt find out how to set the transparency.
definition by "col=" in par() or segments() doesnt seem to work
any suggestions?
Thanks in advance.
Kind regards,
Robert Pazur
example code:
xx2 <
On Jan 10, 2013, at 6:54 AM, masepot wrote:
> Hi, I'm struggling with errbar graphics.
>
> I'm trying to plot an x-y graph with correct labelling, however can't seem
> to get main and sub to show on my graph.
If you are like me you are perhaps being surprised by the fact that the
"subtitle" s
Dear Arun,thankyou very much...
> Date: Thu, 10 Jan 2013 12:02:31 -0800
> From: smartpink...@yahoo.com
> Subject: Re: merging command
> To: eliza_bo...@hotmail.com
> CC: r-help@r-project.org
>
> HI Eliza,
>
> You could do this:
> set.seed(15)
> mat1<-matrix(sample(1:800,124*12,replace=TRUE),nro
On Jan 10, 2013, at 12:04 PM, Patrick Burns wrote:
Did you try:
mm <- subset(agr1, subset= !(lmpcrd %in% c(11697,149823,7654)))
And it might be noted that this is part of the last example on the
help page:
?'%in%'
--
David.
(Actually the parentheses that I added are
not necessary, bu
I believe the problem could be that xyplot uses grid graphics and plot.new
and curve are base graphics functions and the 2 graphics systems (grid and
base) don't play nicely together without a little extra work. In general
the gridBase package helps them play nicely, but I am not sure that it will
Did you try:
mm <- subset(agr1, subset= !(lmpcrd %in% c(11697,149823,7654)))
(Actually the parentheses that I added are
not necessary, but they make me feel better.)
Pat
On 10/01/2013 19:54, ramoss wrote:
Hello,
I need to subset my dataframe into 2 parts; in: mm <- subset(agr1,
subset=lmp
To further the understanding of the loess fit and how the tricube weight
work you may want to look at the loess.demo function in the TeachingDemos
package. It will create a scatterplot of the data and show the loess fit,
then when you click on the plot it will show the weights used for
predicting
Hello,
I need to subset my dataframe into 2 parts; in: mm <- subset(agr1,
subset=lmpcrd %in% c(11697,149823,7654))
not in: but where do I stick the " !" in the above? I've tried every
position.
Thanks for your help.
--
View this message in context:
http://r.789695.n4.nabble.com/Subs
Hello R-help subscribers,
I am analyzing a data set using a mixed logit model, and I have recently
discovered some curious behavior. I am hoping you all can help.
I first ran the following model in December 2012.
lmer(Response.binary ~ ItemType.c * Block + (1 | Subject) + (1 | Word),
data=lexde
Hi all,
I've posted this question before, but did not get any reply. I post it
again here and see if anybody can help. Thank you.
I have a nested model with the following effects
fixed: treatments
random: experiment_date
I used lme() to model the data
mod1 <- lme(N_cells ~treatments-1, r
HI,
Try this:
mat[match(ind,mat[,2]),]
# [,1] [,2]
#[1,] "y" "c"
#[2,] "x" "b"
#[3,] "z" "d"
#[4,] "w" "a"
A.K.
- Original Message -
From: array chip
To: "r-help@r-project.org"
Cc:
Sent: Thursday, January 10, 2013 1:21 PM
Subject: [R] sort matrix based on a specific o
You should contact the maintainer of package Hmisc:
Maintainer: Charles Dupont
As you note, it would not be difficult to use the titles() function to get
what you want or a plot command to set up but not plot data followed by the
errbar() with add=TRUE.
Thank you all for the suggestions, fantastic!
From: Rui Barradas
Cc: "r-help@r-project.org"
Sent: Thursday, January 10, 2013 10:32 AM
Subject: Re: [R] sort matrix based on a specific order
Hello,
Try the following. order() gives you a permutation of the
Hello,
Try the following. order() gives you a permutation of the vector 'ind'
and to order that permutation gives its inverse.
mat <- cbind(c('w','x','y','z'),c('a','b','c','d'))
ind <- c('c','b','d','a')
ord <- order(ind)
mat[order(ord), ]
Hope this helps,
Rui Barradas
Em 10-01-2013 18:21,
more complete example
> mat<-cbind(c('w','x','y','z'),c('a','b','c','d'))
> matOrd <- mat[order(factor(mat[,2], levels = c('c', 'b', 'd','a'))), ]
> matOrd
[,1] [,2]
[1,] "y" "c"
[2,] "x" "b"
[3,] "z" "d"
[4,] "w" "a"
>
On Thu, Jan 10, 2013 at 1:21 PM, array chip wrote:
> Hi I have a
You can use factor() or match() to specify a particular order. E.g.,
> mat<-cbind(c('w','x','y','z'),c('a','b','c','d'))
> ind<-c('c','b','d','a')
> mat[ order(match(mat[,2], ind)), ]
[,1] [,2]
[1,] "y" "c"
[2,] "x" "b"
[3,] "z" "d"
[4,] "w" "a"
> mat[ order( factor(
Hello,
Here are two ways.
dat <- read.table(text = "
id1id2 value
2353 2353 0.096313
2353 2409 0.301773
[...etc...]
2356 2356 0
2356 2611 0
2611 2611 0
", header = TRUE)
mat1 <- matrix(nrow = 53, ncol = 53) # initialize with NA's
mat1[upper.tri(mat1, diag = TRUE)
Define them as factors with a specified order for your sorting.
e.g.
x <- factor(your_data, levels = c('c', 'b','d', 'a'))
On Thu, Jan 10, 2013 at 1:21 PM, array chip wrote:
> Hi I have a character matrix with 2 columns A and B, If I want to sort the
> matrix based on the column B, but based
Hi I have a character matrix with 2 columns A and B, If I want to sort the
matrix based on the column B, but based on a specific order of characters:
mat<-cbind(c('w','x','y','z'),c('a','b','c','d'))
ind<-c('c','b','d','a')
I want "mat" to be sorted by the sequence in "ind":
[,1] [,2]
[1,]
Hi All,
I found this issue when using asCairoDevice to transforming splom scatter plot
to my RGtk2 GUI:
If I put the code in R GUI or using CairoPNG or Cairo_pdf() to draw the scatter
plot, I can get it correctly:
The codes are: (you can copy and paste to your R GUI)
super.sym <- trellis.par.
Dear all,
I have a question about estimation in two phases sampling.
I' have a first sample of household from a complex sampling S1, a second sample
is drawned from S2.
from S2, I compute an estimator y2, for households of S1 not in S2 I set y2=0.
I have an estimator y1 on S1
My indicator is
This is the only public reference at the moment:
http://yihui.name/knitr/hooks (which has explained why your hook does
not work)
Or learn by examples: https://github.com/yihui/knitr-examples (e.g. example 045)
Or in the spirit of "Luke, use the source!", see https://github.com/yihui/knitr
Regard
On 10 January 2013 15:04, wrote:
> Hi,
> I have two variables x and y and the functional relationship between x and y
> is like: y=x^2+log(x). My question is that is it possible to apply some
> method to reconstruct the functional form based on the training data that is
> generated from it? I und
On 13-01-09 9:09 PM, Duncan Murdoch wrote:
On 13-01-09 3:25 PM, michele caseposta wrote:
Hello everyone.
I am in the process of writing a book in Latex with Texshop, on Mac.
This book contains a lot of R code, hence the need to use Sweave.
I was able to compile Rnw files, and to sync back and fo
You could make your 'f' a generic function and define methods
for various types. E.g., using S3 generics, define
f <- function(a, b) UseMethod("f")
f.default <- function(a, b) 10 * a + b
f.data.frame <- function(df) f(df$a, df$b)
and use them as
> f(b=5:7, a=1:3)
[1] 15 26 37
> f(1:
FAQ 7.31
On Thursday, January 10, 2013, Stephan Mueller wrote:
> Hi,
>
> I am working with large numbers and identified that R looses precision
> for such high numbers.
>
> The precision is lost exactly when the number is equal or larger than 53
> bits. See the following output which shows that t
On 13-01-10 6:01 AM, Stephan Mueller wrote:
Hi,
I am working with large numbers and identified that R looses precision
for such high numbers.
The precision is lost exactly when the number is equal or larger than 53
bits. See the following output which shows that the numbers below 53 bit
have pr
Dear All,
I am using the following model equation:
k*(lambertW_base(b=0,((a)/k)*exp(((a)-z*(t-t0))/k)))
I would like to run this through OpenBUGS, but it does not recognize the
lambert function. Would you have any thoughts on how to re-vrite this equation
matemathically so that it could be
Hi, I'm struggling with errbar graphics.
I'm trying to plot an x-y graph with correct labelling, however can't seem
to get main and sub to show on my graph.
They do work when I use title(main="," etc, but this will make it look
at lot messier,I'll have to blank out ylab=" " , and I need to t
> I am working with large numbers and identified that R looses
> precision for such high numbers.
Yes. R uses standard 32-bit double precision. See ?double in your R help
system. And welcome to finite precision arithmetic, which is a very widely
known issue in digital comuting ever since it w
mgcv: Constructing probabilities for binomial GAM with crossed random
intercepts and factor by variable
Hello,
(I'm sorry if this has been discussed elsewhere; I may not have been
looking in the right places.)
I ran a binomial GAM in which "Correct" is modelled in terms of the
participant's
Perhaps here?: https://r-forge.r-project.org/projects/rmpfr/
M
On Thu, Jan 10, 2013 at 10:58 AM, Stephan Mueller
wrote:
>
>
> I am working with large numbers and identified that R looses precision
> for such high numbers.
>
> The precision is lost exactly when the number is equal or larger than
Hi Yao,
Did comparison of the different methods:
dat2<- dat1[rep(row.names(dat1),2000),]
nrow(dat2)
#[1] 4
row.names(dat2)<-1:4
dd <- dat2[,-(1:4)]
foo <- function(x) table(factor(unlist(strsplit(as.character(x), "")), levels
= c('A','C','G','T')))
system.time(res3<-t(apply(dat2
Hi,
I have two variables x and y and the functional relationship between x
and y is like: y=x^2+log(x). My question is that is it possible to
apply some method to reconstruct the functional form based on the
training data that is generated from it? I understand that there are
many methods
Greetings to you all,
I am performing a semi parametric bootstrap in R on a Gamma Distributed
data and a Binomial distributed data. The main challenge am facing is
the fact that the residual variance depends on the mean (if I am correct).
I strongly feel that the script below may be wrong due t
-- ___ Paul K. Musingila University of
Hasselt, I-Biostat, Diepenbeek, Belgium Mobile: +254-724-423532,
+32-48-637-4558 E-mail: paul.musing...@student.uhasselt.be,
pmusing...@gmail.com Skype: pmusingila "When darkness overtakes the
godly, light will come bursting i
Hi,
I am working with large numbers and identified that R looses precision
for such high numbers.
The precision is lost exactly when the number is equal or larger than 53
bits. See the following output which shows that the numbers below 53 bit
have proper precision:
> 2^53
[1] 9007199254740992
>
Greetings to you all,
I am performing a semi parametric bootstrap in R on a Gamma Distributed
data and a Binomial distributed data. The main challenge am facing is
the fact that the residual variance depends on the mean (if I am correct).
I strongly feel that the script below may be wrong due t
Hi.
This is my first post to the list so apologies if it is not formatted
correctly.
I have a dataset from a forest survey with trees marked in an arbitrary
co-ordinate system of the form:
X from 1000 to 1100, and
Y from 1000 to 1100.
I have recently resurveyed the forest and found trees that I
Hi,
I am working with large numbers and identified that R looses precision
for such high numbers.
The precision is lost exactly when the number is equal or larger than 53
bits. See the following output which shows that the numbers below 53 bit
have proper precision:
> 2^53
[1] 9007199254740992
>
Thanks for clarifying!
On Thu, Jan 10, 2013 at 12:47 PM, Uwe Ligges
wrote:
>
>
> On 08.01.2013 21:14, Claus O'Rourke wrote:
>>
>> Hi all,
>> I've encountered an issue using svm (e1071) in the specific case of
>> supplying new data which may not have the full range of levels that
>> were present i
I'd move this to the R-SIG-Fedora list and, in doing so, give more
info about your install process: built yourself, package manager, etc.
MW
On Wed, Jan 9, 2013 at 7:31 PM, Adam Dahman wrote:
> Hi,
>
> I have installed R on linux using a non root account.
>
> I am getting this error when trying
On 08.01.2013 21:14, Claus O'Rourke wrote:
Hi all,
I've encountered an issue using svm (e1071) in the specific case of
supplying new data which may not have the full range of levels that
were present in the training data.
I've constructed this really primitive example to illustrate the point:
On Jan 9, 2013, at 9:00 PM, ivo welch wrote:
> mea culpa.
>
> f <- function(...) {
> ## parse out the arguments and then do something with them
> }
>
> ## all of these should result in the same actions
> f(2,3) ## interprets a to be first and b to be second
> f(a=2,b=3)
> f(b=3,a=2)
These
there isn't much, but Dr. Lumley's book is probably your best bet.. up
till now, i think most people have learned survey methodology in the
abstract and then applied that theory to their language of choice :)
http://www.amazon.com/Complex-Surveys-Analysis-Survey-Methodology/dp/0470284307
On Wed
On 10 January 2013 01:04, Yao He wrote:
> In fact I want to calculate the gene frequency of each SNP.
Why don't you use bioconductor for your analysis instead of trying to
develop by your own? For example:
http://www.bioconductor.org/help/course-materials/2008/MGED08/BiostringsMGED2008.pdf
For
Thanks everyone, very helpful.
On 9 January 2013 18:33, David Winsemius wrote:
>
> On Jan 9, 2013, at 8:53 AM, Aidan MacNamara wrote:
>
>> Dear all,
>>
>> I'm looking to create a formula within a function to pass to glmer()
>> and I'm having a problem that the following example will illustrate:
>
HI Yao,
You could use this: (Jorge's solution may be faster, I didn't check)
idx<-sapply(strsplit(names(res),split=""),anyDuplicated) #res from the previous
solution:
res1<-do.call(cbind,lapply(LETTERS[c(1,3,7,20)],function(i){rowSums(data.frame(rowSums(res[idx==0][grep(i,names(res)[idx==0])]),2*
Hi Yao,
You could also use:
library(reshape2)
dd<-dat1[,-(1:4)]
res<-dcast(melt(within(dd,{id=row.names(dd)}),id.var="id"),id~value,length)
head(res)
# id AA AG CC CT GA GG GT TC TG TT
#1 27412 29 10 0 0 13 1 0 0 0 0
#2 27413 0 0 4 9 0 0 0 12 0 28
#3 27414 0 0 0 0 0 0 0 0
I tried to use this solution (from over two years ago, but it remains an
official demo), but found that it only captured the last warning rather than
all of them. Instead, the code below collects all warnings.
tryCatch.W.E <- function(expr)
{
W <- list()
w.handler <- function(w){ # warni
71 matches
Mail list logo