Dear R Users,
I have the following glm, which I am running several times in a loop
(I am not including the full code):
reduced_model <- NULL;
full_model <- NULL;
reduced_model <- try(glm.fit(X4,n,family=poisson(link="log")))
full_model <- try(glm.fit(X5,n,family=poisson(link="log")));
On some oc
The trick is to use the fitted() function, not predict(), to get your fitted
values. You should then be able to use that vector of values in just the
same way that you use your current mean values as below.
Darren Norris wrote:
>
>
> lmodel<-with(a_dataframe,lm(mean_ind~sin(time*2*pi)+cos(tim
... or in one step
df <- transform(df,
col1 = ifelse(col1 > 3, NA, col1))
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of K. Elo
Sent: Friday, 15 February 2008 4:29 PM
To: r-help@r-project.org
Subject: Re: [R] data frame question
Hi,
Hi all,
I have a data of lognormal distribution (sample size > 1,000,000).
What I want to do is
1) to test if my dataset is a lognormal distribution or not (Histogram shows
a nice normal distribution in log scale but I want to check)
2) two subsets from this dataset have same mean or not (like "t
Hi,
joseph wrote (15.2.2008):
> Thanks. I have another question:
> In the following data frame df, I want to replace all values in col1
> that are higher than 3 with NA. df= data.frame(col1=c(1:5, NA),col2=
> c(2,NA,4:7))
My suggestion:
x<-df$col1; x[ x>3 ]<-NA; df$col1<-x; rm(x)
-Kimmo
__
Hi all,
I have a data of lognormal distribution (sample size > 1,000,000).
What I want to do is
1) to test if my dataset is a lognormal distribution or not (Histogram shows
a nice normal distribution in log scale but I want to check)
2) two subsets from this dataset have same mean or not (like "t
Have you tried making a list of data frames instead? So
data.list<-list()
for (i in 1:20) {
g<-sample(rep(LETTERS[1:2],each=10))
#make a name
a.name<-paste("combination",i,sep="")
#add it to the list of data frames
data.list[[a.name]]<-data.frame(tab,g)
}
This shoul
Learn to use the power and flexibility of R subscripting.
## Warning:untested
apply(df,1,function(x)any(!is.na(x)))
gives TRUE for all rows that aren't all NA's.
So stick this expression into the 1st coordinate of a subscript for the df:
df[apply(df,1,function(x)any(!is.na(x))),]
Cheers,
Bert
Hi
I have a data frame df with 3 columns. Some rows are NA across all 3 columns.
How can I remove rows with NA across all columns?
df=data.frame(col1=c(1:3,NA,NA,4),col2=c(7:9,NA,NA,NA),col3=c(2:4,NA,NA,4))
Thanks
Joseph
I am modelling (at least trying to) the seasonal component of a variable
using lmer. I think I am just about getting the hang of building the models
but want to see what the fitted values look like.
I need to plot 2 lines on the same graph - the original data ( copy of
dataframe below) and the fit
Hi R users
I am a new user in the field of R.
I want to subset or reshape a data.frame.
For example I have a matrix like
A B C D E F G
a 1 2 3 4 5 6 7
b 4 6 8 9 5 5 6
c 3 4 4 4 3 3 6
d 1 2 4 6 8 8 9
e 5 6 7 8 9 2 3
I want to reshape the matri
Use a 'list' to capture the data within the loop:
> result <- vector('list', 20) # preallocate
> tab <- data.frame(x=1:20)
> for (i in 1:20) {
+
+ g<-sample(rep(LETTERS[1:2],each=10))
+ result[[i]] <-data.frame(tab,g)
+
+ }
> # you can now access the combinations like this:
> result[[1]]
Willi Nagl gmail.com> writes:
>
> I try to start Rmcdr from JGR. The Rmcdr-Windows comes up correctly; but
> the
> Menu-Bar in the Rcmdr-Window goes away, if I try to go into the
> Rmcdr-Window.
>
> I hope, someone has a solution.
>
> Regards, willi
>
My experience is that, under Windows,
Dear R,
I am currently trying to caculate the coefficient of determination for
different quantile regression models. For example
fit<-rq(Hrubra~SessileInvertebrates,tau=0.8, data=Q1)
fit1<-rq(Hrubra~SessileInvertebrates,tau=0.8, data=Q2)
etc
Could someone please advise me how do you calculate
Dear all:
Assume I have 3 distributions, x1, x2, and x3.
x1 ~ normal(mu1, sd1)
x2 ~ normal(mu2, sd2)
x3 ~ normal(mu3, sd3)
y1 = x1 + x2
y2 = x1 + x3
Now that the data I can observed is only y1 and y2. It is
easy to estimate (mu1+m2), (mu1+mu3), (sd1^2+sd2^2) and
(sd1^2+sd3^2) by EM algorithm since
Hi,
I run the following models:
1a. lmer(Y~X+(1|Subject),family=binomial(link="logit")) and
1b. lmer(Y~X+(1|Subject),family=binomial(link="logit"),method="PQL")
Why does 1b produce results different from 1a? The reason why I am asking is
that the help states that "PQL" is the default of GLMMs
Dear R-helpers,
I need to retrieve the data frames generated in a
for loop. What I have looks something like this:
where tab is a pre-existing data frame.
for (i in 1:20) {
g<-sample(rep(LETTERS[1:2],each=10))
combination<-data.frame(tab,g)
}
I tried to name every single combi
Thanks. I have another question:
In the following data frame df, I want to replace all values in col1 that are
higher than 3 with NA.
df= data.frame(col1=c(1:5, NA),col2= c(2,NA,4:7))
- Original Message
From: John Kane <[EMAIL PROTECTED]>
To: joseph <[EMAIL PROTECTED]>; r-help@r-project.
?write.table and look at the row.names arguement
which is what they are called in this instance.
write.table(XX, file="XX.txt",quote=FALSE,sep="\t",
row.names=FALSE)
--- Roberto Olivares Hernandez <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I used the write.table function to save data in txt
> file,
On Thu, 14 Feb 2008, samsr wrote:
>
> Hi,
>
> I need to plot a matrix using image() such that negative values are easily
> distinguishable from posittive values, while also maintaining a gradation in
> color with magnitude. How can I set ranges for colors in order to achieve
> this. Thanks.
Look
Hi I am using forestplot() in rmeta package on a
dataset of 45 point estimates with corresponding
confidence intervals. The resulting plot was just too
large and plotted out of the graphic window that I can
not see whole picture. Is there anyway to fix this
problem?
Thanks
___
Phil Spector wrote:
> Ricardo -
> The authentication can't be done through environmental variables --
> the only way is to send an Authorization header. I believe the
> environmental variables that Dieter is thinking of are the ones that
> are created on the server side based on the headers
Perhaps matplot will do what you want?
?matplot
aa <- matrix(1:25, nrow=5)
matplot(aa)
--- tomaschwutz <[EMAIL PROTECTED]> wrote:
> How do a plot several columns of a matrix at once in
> a single plot
> versus a single x-variable?
>
> The default plot.matrix or plot.dataframe commands
> plot ea
Create the new data.frame and do the muliplying on it?
df2 <- df1
df2[,1] <- df2[,1]*2
--- joseph <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I have a data frame df1 in which I would like to
> multiply col1
> by 2.
>
>
> The way I did it does not allow me to keep the old
> data
> frame.
>
>
>
Hi Sam,
You might find it easier to use ggplot2 to do this. See
http://had.co.nz/ggplot2/geom_tile.html for some examples.
Hadley
On Thu, Feb 14, 2008 at 2:59 PM, samsr <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I need to plot a matrix using image() such that negative values are easily
> distin
Yes, it does - thank you!
The only thing I forgot (and it took me a while to
find this out) was to separate the fields by
semicolon, i.e. the correct command is:
odbcDriverConnect("driver=SQL Server;
database=dataBaseName; wsid=myComputer;
server=dataBaseServer; uid=moshe; pwd=moshe")
--- Prof Br
RSiteSearch is your friend. E.g.:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/63365.html
and then click on 'Next in thread a couple of times
Gabor
On Thu, Feb 14, 2008 at 03:23:30PM -0600, Edna Bell wrote:
> Dear R Gurus:
>
> How do you get source for functions which say "UseMethod" wh
There is nothing wrong with a loop for handling this case. Most of
your time is probably going to be spent writing out the files. If you
don't want 'for' loops, you can use 'lapply', but I am not sure what
type of "performance" improvement you will see. You are having to
make decisions on each p
On Thu, 14 Feb 2008, SNN wrote:
>
> Thanks for the advice.
>
> I tried to find the cov of my matrix using R and it ran out of memory.
How did you do this? The covariance matrix is only 115x115, so it
shouldn't run out of memory
cov(t(code))
should work
If that doesn't work then
tcrossprod
Dear R Gurus:
How do you get source for functions which say "UseMethod" when you
type in their names, please?
I've tried getAnywhere and getMethods...I thought that might produce them.
Thanks in advance.
Sincerely,
Edna
__
R-help@r-project.org mailin
Thanks for the input! It does work fine, however I'll have to do
another loop to repeat this whole process quite a few times (10^3,
10^4 particles maybe), so I was hoping for a solution without loop.
Maybe I could reshape all the values into a big array, dump it to a
file and replace some v
Hi,
I need to plot a matrix using image() such that negative values are easily
distinguishable from posittive values, while also maintaining a gradation in
color with magnitude. How can I set ranges for colors in order to achieve
this. Thanks.
Sam
--
View this message in context:
http://www.n
Could you tell us which version of the lme4 package you are using?
You can just send the output produced by
sessionInfo()
If you can make your data available so we can test it then please do
so. If the data set is large you could send it to me in private email
and I will make it available on a w
Hi all,
This was posted originally on r-sig-mixed-models, but I thought I
would post here as well as it might be of more general interest.
With a colleague, I have been trying to implement the Conditional AIC
described by Vaida and Blanchard 2005 Biometrika, "Conditional Akaike
information
Karen
For indices, use the minus sign: yourData[-indicesToBeDeleted,]
For rownames, negate %in%:
yourData[!rownames(yourData)%in%namesToBeDeleted,]
HTH
Peter Alspach
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Chang Liu
> Sent: Friday, 15 F
Hi, I'm wondering what the fastest way is to delete certain data points
(observations) in a data frame.
I have a vector of the indices/row.names I would like to delete. I have tried
replacing list by list, but it always complains about different lengths,
"replacing list of length a with length
Dear R-list,
Thanks a lot for your help. Thanks to Jim, Dimitris and Phil. It's exactly
what I needed to do.
Jorge
On 2/14/08, Jorge Iván Vélez <[EMAIL PROTECTED]> wrote:
> Dear R-list,
>
> I'm working with a data frame which dimensions are
>
> > dim(GERU)
> [1] 3468 318
>
> and looks like
>
It's, Jim. Thank you so much.
Jorge
On 2/14/08, jim holtman <[EMAIL PROTECTED]> wrote:
>
> Is this what you want to do?
>
> > x <- data.frame(a=1:10, b=1:10, c=1:10, d=1:10)
> > z <- cbind(c=11:20, d=11:20)
> > z
> c d
> [1,] 11 11
> [2,] 12 12
> [3,] 13 13
> [4,] 14 14
> [5,] 15 15
> [6,
try this:
GERU[6:318] <- lapply(GERU[6:318], function (x) {
if (length(unique(x[!is.na(x)])) >= 5) x[x == 2] <- 3
x
})
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijn
Thanks for the advice.
I tried to find the cov of my matrix using R and it ran out of memory. I am
not sure how to do double loop to create the covariace matrix? Also is
doing prcomp( covariace matrix) the same as finding
prcomp( original data ,matrix of snps)?
Thanks for your help,
Thomas
Is this what you want to do?
> x <- data.frame(a=1:10, b=1:10, c=1:10, d=1:10)
> z <- cbind(c=11:20, d=11:20)
> z
c d
[1,] 11 11
[2,] 12 12
[3,] 13 13
[4,] 14 14
[5,] 15 15
[6,] 16 16
[7,] 17 17
[8,] 18 18
[9,] 19 19
[10,] 20 20
> x[,colnames(z)] <- z[, colnames(z)]
> x
a b
Small correction: I meant to say that I had been reading:
J. C. Pinheiro and D. M. Bates (2000), “Mixed-Effects Models in S and
S-Plus”, Springer.
Kevin Crowston
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Dear R-list,
I'm working with a data frame which dimensions are
> dim(GERU)
[1] 3468 318
and looks like
> GERU[1:10,1:10]
ped ind par1 par2 sex sta rs7696470 rs7696470.1 rs1032896 rs1032896.1
1 USA5854 200 2 1 4 4 1 1
2 USA5854 3
I have an experiment I'm trying to analyze that's turning out to be
more complicated than I anticipated, so I was hoping for some
suggestions about how to handle it.
The lab experiment is a comparison between two search interfaces.
After a little training, each subject performs 12 informati
Hi Philip,
your data are event times because you're monitoring the same trees in
each plot over time, the event being death of a tree.
Therefore methods from survival analysis are more appropriate.
Start out having a look at the package survival, possibly considering
a Cox model with adjustment
Try this:
values <- c(1,1,1,4,5,5,6)
with(rle(values), plot(values, lengths))
But I think that you can use barplot:
barplot(table(values))
On 14/02/2008, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>Hi,
>
>i'd like to plot some data that I have with the value on the x axis and
> fr
How do we know what value corresponds to what new
variable?
library(reshape)
mm <- melt(d, id="group")
cast(mm, group~value)
will give you something but not quite what you want.
--- Shubha Vishwanath Karanth
<[EMAIL PROTECTED]> wrote:
> Hi R,
>
>
>
> Can I transpose a data frame by a part
Here are a couple of ways depending on what you want.
data1=c(1,1,1,4,5,5,6)
plot(table(data1))
---
plotvec <- as.vector(aa)
nns <- names(aa)
plot(plotvec, xaxt="n")
mtext(nns, at=1:4, side=1)
---
--- "[EMAIL PROTECTED]"
<[EMA
Try this:
x[grep("vehicle", x, ignore=T)] <- "Vehicle"
On 14/02/2008, Judith Flores <[EMAIL PROTECTED]> wrote:
> Dear R-experts,
>
> I need to replace the values of a vector(tx) with a
> word ('Vehicle') when the value of the vector contains
> the word 'vehicle'. Sometimes, the value could be
[EMAIL PROTECTED] wrote:
> Hello all,
>
> I have a new Redhat enterprise system that I'm trying to get set up with all
> the goodies I need, including R-2.6.1. I got all of the required dependencies
> including readline. However, configure dies with:
> configure: error: --with-readline=yes (defau
Dear R-experts,
I need to replace the values of a vector(tx) with a
word ('Vehicle') when the value of the vector contains
the word 'vehicle'. Sometimes, the value could be 'MCT
vehicle', or 'control-vehicle', etc.
I tried gsub like this
treatment<-gsub('vehicle','Vehicle', tx,
ignore.case=
> Of course your reasoning is clear and an in better knowledge about R
> will help me to better interpret its error messages in the future. But
> for an entry-level R user like me a conflict warning will be quite helpful.
The next version of reshape should do better - I check whether
fun.aggreg
> system.time({
+ tab2 <- tab1 <- with(pisa1, table(CNT,GENDER,ISCOF,ISCOM))
+ tab2[] <- 0
+ tab2[which(tab1 == 1, arr.ind = TRUE)] <- 1
+ tab3 <- rowSums(tab2)
+ })
user system elapsed
3.170.994.17
>
> system.time({
+ tab4 <- rowSums(tab1 == 1)
+ })
user system elapsed
Hello all,
I have a new Redhat enterprise system that I'm trying to get set up with all
the goodies I need, including R-2.6.1. I got all of the required dependencies
including readline. However, configure dies with:
configure: error: --with-readline=yes (default) and headers/libs are not
availa
Phillip J van Mantgem usgs.gov> writes:
>
> I am wondering if there is an R function that could estimate a generalized
> nonlinear mixed model.
>
Short answer: no (not really/not that I'm aware of).
Long answer: AD Model Builder? WinBUGS? shortcuts like
nlme applied to the proportion d
On Thu, 14 Feb 2008, Uwe Ligges wrote:
>
>
> Brian Flynn wrote:
>> I am trying to do a ks.test in R 2.6.2 (running on Mac OS X 10.4.11).
>> In the help guides it specifies that the y variable can be a
>> character string for the type of distribution I want. I am doing this
>> on the residuals of a
Hint:
x1 <- rep(pi, 283)
y1 <- rnorm(283)
summary(lm(y1 ~ x1))
More generally, see ?alias.
The idea of singularity is a linear model is a statistical one, so it may
be time to revisit your statistical education or read a good book on the
subject (MASS comes to mind in this context).
On Thu,
From: Hans W. Borchers
> Christopher Schwalm umn.edu> writes:
>
> >
> > Hello List,
> >
> > I've been unsuccessful in tracking down a package that does MART. J
> > Friedman's website has a page that mentions an R
> implementation but the
> > links lead nowhere. There is also a nice walkthr
Matthias Gondan wrote:
> Frank E Harrell Jr schrieb:
>> Matthias Gondan wrote:
data(colon)
s = survfit(Surv(time, status) ~ rx, data=colon)
plot(s)
plot(s, col=1:3)
>>> By the way: Does anyone know a neat way to indicate the number of
>>> patients under risk in
>>> the curve?
>>
Brian Flynn wrote:
> I am trying to do a ks.test in R 2.6.2 (running on Mac OS X 10.4.11).
> In the help guides it specifies that the y variable can be a
> character string for the type of distribution I want. I am doing this
> on the residuals of a regression model, but I continue to get a
Hello,
I'm doing an lm(y1~x1), no NAs in them, both of length 283.
I get out however and 'NA' for the estimate of x1 and summary gives:
Residuals:
Min 1Q Median 3Q Max
-0.1998309 -0.0447269 -0.0006252 0.0390933 0.3141687
Coefficients: (1 not defined because of singulari
I am trying to do a ks.test in R 2.6.2 (running on Mac OS X 10.4.11).
In the help guides it specifies that the y variable can be a
character string for the type of distribution I want. I am doing this
on the residuals of a regression model, but I continue to get an
error. This is some of th
On Thursday 14 February 2008 06:27:07 pm Stefan Grosse wrote:
SG> df$col3<-df1$col1*2
ups it should be
df1$col3<-df1$col1*2
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-
On Thursday 14 February 2008 06:12:11 pm Willi Nagl wrote:
WN> I try to start Rmcdr from JGR. The Rmcdr-Windows comes up correctly; but
WN> the
WN> Menu-Bar in the Rcmdr-Window goes away, if I try to go into the
WN> Rmcdr-Window.
WN>
WN> I hope, someone has a solution.
WN>
WN> Regards, willi
WN>
On Thursday 14 February 2008 06:12:23 pm joseph wrote:
jo> I have a data frame df1 in which I would like to multiply col1
jo> by 2.
jo> The way I did it does not allow me to keep the old data
jo> frame.
jo>
jo>
jo> How can I do this and be able to create a new data frame
jo> df2?
jo>
jo>
jo> > df1$
transpose the matrix and then use 'matplot'
On 2/14/08, Marek Bartkuhn <[EMAIL PROTECTED]> wrote:
> Dear R users,
>
>
> I like to plot a matrix A which looks like this:
>
>
>,1 ,2 ,3 ,4
>
> 1, 1 10 100 1000
I try to start Rmcdr from JGR. The Rmcdr-Windows comes up correctly; but
the
Menu-Bar in the Rcmdr-Window goes away, if I try to go into the
Rmcdr-Window.
I hope, someone has a solution.
Regards, willi
--
0(049)753124283 privat
0(049)7531882641 büro
[[alternative HTML version delete
If I understand:
df2 <- transform(df1, col3=col1*2)
On 14/02/2008, joseph <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I have a data frame df1 in which I would like to multiply col1
> by 2.
>
>
> The way I did it does not allow me to keep the old data
> frame.
>
>
> How can I do this and be able
df2 = df
?
G.
On Thu, Feb 14, 2008 at 09:12:23AM -0800, joseph wrote:
>
>
> Hi
>
> I have a data frame df1 in which I would like to multiply col1
> by 2.
>
>
> The way I did it does not allow me to keep the old data
> frame.
>
>
> How can I do this and be able to create a new data frame
Hi
I have a data frame df1 in which I would like to multiply col1
by 2.
The way I did it does not allow me to keep the old data
frame.
How can I do this and be able to create a new data frame
df2?
> df1= data.frame(col1= c(3, 5, NA, 1), col2= c(4, NA,6,
2))
> df1
col1 col2
13
Dear R users,
I like to plot a matrix A which looks like this:
,1 ,2 ,3 ,4
1, 1 10 100 1000
2, 0.5 0.2 1.0 4.3
3, 0.1 0.2 0.3
Hi Kes,
Try
> library(help=car)
> ?levene.test
or "levene" in http://www.rseek.org/ (first hit).
I hope this helps,
Jorge
On 2/14/08, Kes Knave <[EMAIL PROTECTED]> wrote:
>
> Dear all
>
> I have tried to find this function in R, but don't find it by searching in
> the help function.
>
> Anyb
On 2/14/08, Felix Andrews <[EMAIL PROTECTED]> wrote:
> You can tell Lattice to stop when an error occurs, like this:
>
> lattice.options(panel.error="stop")
> xyplot(1:10 ~ 1:10, panel=function(...) stop("foo"))
> # -> Error in panel(x = 1:10, y = 1:10) : foo
>
> That is a little more informati
Here is a start. You basically have to interate through your data and
use 'cat' to write it out:
particle <- list(dose=c(1,100.0,0),pos=data.frame(x=c(0,1,0,1),y=c(0,1,0,1)))
output <- file("/tempxx.txt", "w")
cat(particle$dose, "\n", file=output, sep=" ")
for (i in 1:nrow(particle$pos)){
cat
Dear R-users,
I'm new to R, so my apologies if this question doesn't make sense.
I've tried the following model in lmer, and it works perfectly:
model<-lmer(aphids~densroot+zone+(1|zone/site), family=quasipoisson)
But if I try the exact same model with a different variable, totmas, the model
lo
Depending on what your final goal is, there may be a better approach,
but to do as you state below, here is one set of options:
1) use read.csv (or read.table) and use the colClasses argument to
specify keeping only column 5
2) use cbind to bind column 5 (now a data.frame) to another data.frame
(p
Deepayan Sarkar gmail.com> writes:
> > I am looking for a lattice-panel for survival (KM/Cox) plots. I know it's
> > not standard, but maybe someone has already tried?
>
> There are some half-formed ideas in
>
> http://dsarkar.fhcrc.org/talks/extendingLattice.pdf
>
> but nothing packaged (most
On Thu, Feb 14, 2008 at 4:57 AM, Ng Stanley <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have some microarray data, cy5 and cy3 values are in log2. Is there a
> way to check they have undergone lowess normalization ?
Yes, go back ask the one who you got the data from.
Honestly, this is a serious rep
Hello,
I am trying to run a piece of Fortran code from R, and I am having trouble
passing an array to the fortran subroutine. My attempts to pass an array into
the fortran are producing memory errors, and I cannot find an example that
performs the task. I have looked at "Writing R Extensions
Thank you Dimitris, Jorge, and Mark (personal mail),
for the hint to matplot and the examples.
This was exactly what I was thinking of.
Thomas
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
Hi,
I need to create a text file in the following format,
> 1 100.0 0
> 0 0
> 1 1
> 0 0
> 1 1
> #
> 1 100.0 0
> 0 0
> 0 1
> 1 0
> 1 1
...
where # is part of the format and not a R comment.
Each block (delimited by #) consists of a first line with three
values, call it dose, and a lis
Hi rich,
>data <- c(1,1,1,4,5,5,6)
>table(data)
data
1 4 5 6
3 1 2 1
hope it helps
josephine
[EMAIL PROTECTED] wrote:
>Hi,
>
>i'd like to plot some data that I have with the value on the x axis and
> freq
>on the y axis.
>
>So, I need to calculate the freq a value is seen withi
On Wed, 13 Feb 2008, Wang, Zhaoming (NIH/NCI) [C] wrote:
>
> Try EIGENSTRAT http://www.nature.com/ng/journal/v38/n8/abs/ng1847.html
The same approach as EIGENSTRAT is pretty straightforward in R.
You need to create the covariance matrix of people (rather than of SNPs)
for the 0/1/2 genotype at
Hi Thomas,
Ckeck ?matplot. Here's a simple example:
# Data set
x=runif(100)# Axis
x1=rnorm(100,25,2) # Variable x_i
x2=rnorm(100,10,1)
x3=rnorm(100,15,4)
x4=rnorm(100,30,4)
DATA=cbind(x,x1,x2,x3,x4)
# Plot
matplot(x,DATA[,2:5],col=1:5,pch=1:5)
I hope this helps.
You can tell Lattice to stop when an error occurs, like this:
lattice.options(panel.error="stop")
xyplot(1:10 ~ 1:10, panel=function(...) stop("foo"))
# -> Error in panel(x = 1:10, y = 1:10) : foo
That is a little more informative than the default "panel.error",
because it tells you the condition
Try also:
reshape(cbind(d, time=unlist(sapply(table(d$group), seq))),
idvar="group", direction="wide")
On 14/02/2008, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote:
> Hi R,
>
>
>
> Can I transpose a data frame by a particular group variable?
>
>
>
> For example:
>
> d=data.frame(group=c(
Frank E Harrell Jr schrieb:
> Matthias Gondan wrote:
>>> data(colon)
>>> s = survfit(Surv(time, status) ~ rx, data=colon)
>>> plot(s)
>>> plot(s, col=1:3)
>>
>> By the way: Does anyone know a neat way to indicate the number of
>> patients under risk in
>> the curve?
> That's one of many options in
you could use the function matplot(), e.g.,
x <- 1:20
vals <- 2 + rep(1:5, each = 20) * rep(x, 5) + rnorm(100)
dim(vals) <- c(20, 5)
matplot(x, vals, type = "l", lty = 1)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catho
I got it right now, It wasn't working because the matrix of predictors had
the same name as the dataset, so I modified the call
creating a dataset with the response and predictors and keeping the
data.frame using the same name
metodocentrod <- data.frame(metodocentro)
resultadocentro <- glm(Ycent
On Thu, Feb 14, 2008 at 03:47:35PM +0100, Kes Knave wrote:
> Dear all
>
> I have tried to find this function in R, but don't find it by searching in
> the help function.
Take a look at in R:
?RSiteSearch
Use this to search for it.
>
> Anybody who knows if R has the function "Levene's test for
On 2/14/2008 9:47 AM, Kes Knave wrote:
> Dear all
>
> I have tried to find this function in R, but don't find it by searching in
> the help function.
>
> Anybody who knows if R has the function "Levene's test for homogeneity of
> variances"?
>
> Note: Im a "R-begginer"
I wonder how you searc
How do a plot several columns of a matrix at once in a single plot
versus a single x-variable?
The default plot.matrix or plot.dataframe commands plot each column
versus each other column in several sub-plots. I want to plot each
column versus a single other vector (x) as several lines or points
On Thu, 2008-02-14 at 15:47 +0100, Kes Knave wrote:
> Dear all
>
> I have tried to find this function in R, but don't find it by searching in
> the help function.
>
> Anybody who knows if R has the function "Levene's test for homogeneity of
> variances"?
results 1 & 2 of:
RSiteSearch("Levene's"
(I posted this to the R-devel list yesterday, but I thought others on
this list would be interested, so sorry for those who get it twice.)
Hello all,
I've developed a prototype package called PopCon (short for popularity
contest), a package for tracking the popularity of R and its packages.
I'
Thanks Marcel,
In addition to your program and the reference to "simecol", someone had
replied to my private email pointing out "RLadyBug": An R package for
stochastic epidemic models which is on CRAN and which seems one of the most
relevant. I write it here as a reference for users doing a future
Matthias Gondan wrote:
> Hi Eleni, hi list,
>
> here is small sample program, the library is "survival", it is included
> in the standard R distribution.
>
>> data(colon)
>> s = survfit(Surv(time, status) ~ rx, data=colon)
>> plot(s)
>> plot(s, col=1:3)
>
> By the way: Does anyone know a neat wa
On Thu, 2008-02-14 at 14:35 +, [EMAIL PROTECTED] wrote:
> Hi,
>
>i'd like to plot some data that I have with the value on the x axis and
> freq
>on the y axis.
>
>So, I need to calculate the freq a value is seen within my data vector
>
>for example, say i have a vector of d
Dear all
I have tried to find this function in R, but don't find it by searching in
the help function.
Anybody who knows if R has the function "Levene's test for homogeneity of
variances"?
Note: Im a "R-begginer"
Regards Kes
[[alternative HTML version deleted]]
___
try this:
d <- data.frame(group = c(1,1,2,2,2), val = c(6,4,6,3,5))
d$time <- unlist(tapply(d$group, d$group,
function (x) seq(1, len = length(x
reshape(d, idvar = "group", direction = "wide")
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
Hi Eleni, hi list,
here is small sample program, the library is "survival", it is included
in the standard R distribution.
> data(colon)
> s = survfit(Surv(time, status) ~ rx, data=colon)
> plot(s)
> plot(s, col=1:3)
By the way: Does anyone know a neat way to indicate the number of
patients unde
1 - 100 of 133 matches
Mail list logo