Displaying 20 results from an estimated 1000 matches similar to: "Advanced Filtering problem"
2024 May 15
2
Extracting values from Surv function in survival package
OS X
R 4.3.3
Colleagues
I have created objects using the Surv function in the survival package:
> FIT.1
Call: survfit(formula = FORMULA1)
n events median 0.95LCL 0.95UCL
SUBDATA$ARM=1, SUBDATA[, EXP.STRAT]=0 18 13 345 156 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=1 13 5 NA 186 NA
SUBDATA$ARM=2, SUBDATA[, EXP.STRAT]=2 5
2024 May 16
1
Extracting values from Surv function in survival package
Hi Dennis,
look at the help page for summary.survfit, the Value n.event.
G?ran
On 2024-05-15 22:41, Dennis Fisher wrote:
> OS X
> R 4.3.3
>
> Colleagues
>
> I have created objects using the Surv function in the survival package:
>> FIT.1
> Call: survfit(formula = FORMULA1)
>
> n events median 0.95LCL 0.95UCL
>
2007 Aug 01
1
Problem to remove loops in a routine
Dear R-users,
I have written the following code to generate some trellis plots. It
works perfectly fine except that it is quite slow when it is apply to my
typical datasets (over several thousands of lines). I believe the
problem comes from the loops I am using to subset my data.frame. I read
in the archives that the tapply function is often more efficient than a
loop in R. Unfortunately ,
2009 Sep 14
3
Eliminate cases in a subset of a dataframe
Hi folks,
I created a subset of a dataframe (i.e., selected only men):
subdata <- subset(data,data$gender==1)
After a residual diagnostic of a regression analysis, I detected three
outliers:
linmod <- lm(y ~ x, data=subdata)
plot(linmod)
Say, the cases 11,22, and 33 were outliers.
Here comes the problem: When I want to exclude these three cases in a
further regression analysis,
- for
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all,
First, let's create some data to play around:
set.seed(1)
(df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10),
Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),])
## Now we need the empirical distribution function:
edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x
##
2003 Mar 25
2
Help with data.frame subsets
Hello all,
I'm trying to get a subset of a data frame by taking all rows where the 2nd
column is >= Min and <= Max. I can do that by a 2 step process similar to
the following:
subData <- dataFrame[dataFrame[,2] >= Min,]
subData2 <- subData[subData[,2] <= Max,]
Then I try to graph the results where col 2 is the X var and col 3 is the Y
var. Therefore I do the following:
X
2011 Oct 31
1
googleVis motionchart - slow with Date class
Hi,
I am trying to create a googleVis motion chart with monthly data. When formatting the date column as a Date class variable, the plot as presented in the browser becomes considerably slower and very prone to crashing the browser. To illustrate this issue I have modified the WorldBank demo.
### objects from demo("WorldBank", package = "googleVis")
M <-
2007 Oct 01
3
mean of subset of rows
Dear list,
this must be an easy one:
I have a data.frame of two columns, "ID" with four different levels (A
to D) and numerical "size", and each of the 4 different IDs is
repeated a
different number of times. I would like to get the mean size for each
ID as another data.frame. I have tried the following:
>ID= as.character(unique(data[,1])) # I use unique() because
2012 Sep 24
0
stop on rows where !is.na(mydata$ti_all)
Dear R experts,
I got help to build a loop but there is a bug inside it that causes
one part of the mechanism to fail.
It should grow once, but if keep growing on rows where $ti_all is not NA.
Here is a wall of code that very crudely demonstrates the problem,
there is a couple of dim() outputs at the end where you can see how it
the second time around keeps adds (2) rows, but this does not
2007 Jun 21
2
Overlaying lattice graphs (continued)
Dear R Users,
I recently posted an email on this list about the use of data.frame and
overlaying multiple plots. Deepayan kindly indicated to me the
panel.superposition command which worked perfectly in the context of the
example I gave.
I'd like to go a little bit further on this topic using a more complex
dataset structure (actually the one I want to work on).
>mydata
Plot
2008 Mar 23
3
"spreading out" a numeric vector
I am creating a timeline plot, but running into a problem in positions
where the values to plot are too close together to print the text
without overlap. The simplest way I can think of to solve this
(although there may be other ways?) is to create a new numeric vector
whose values are as close as possible to the original vector, but
spread out to a given minimum difference. For example, take
2008 Mar 03
2
handling big data set in R
Hello R users,
I'm wondering whether it is possible to manage big data set in R? I
have a data set with 3 million rows and 3 columns (X,Y,Z), where X is
the group id. For each X, I need to run 2 regression on the submatrix.
I used the function "split":
datamatrix<-read.csv("datas.csv", header=F, sep=",")
dim(datamatrix)
# [1] 2980523 3
2002 Sep 30
0
using step function in functions
Help!
I am a new R user. It has been slow getting up to speed, but definitely
rewarding. I have come up against a problem I can't handle. I would
very much appreciate any help.
I am writing a vector auto regression (VAR) function that utilizes existing
R statistical functions. I would like to use the step function to do
step-wise elimination on each univariate time series model. No
2017 Jan 10
7
[Bug 99354] New: [G71] "Assertion `bkref' failed" reproducible with glmark2
https://bugs.freedesktop.org/show_bug.cgi?id=99354
Bug ID: 99354
Summary: [G71] "Assertion `bkref' failed" reproducible with
glmark2
Product: Mesa
Version: 13.0
Hardware: x86 (IA32)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
2012 Nov 10
4
help on date dataset
Hi everybody,
I am beginer in R and I need your precious help.
I want to create a small function in R as in sas to retrieve date.
I have a file with data that import in R.
DATE PAYS nb_pays.ILI.
1 24/04/2009 usa 0
2 24/04/2009 usa 0
3 24/04/2009 Mexique 0
4 24/04/2009
2012 Apr 30
1
Subtract days to dates in POSIXct format
Hello,
I'm having problems working with date values in POSIXct format. Here is what I got (eg.lig attached):
x <- read.table("eg.txt", sep = ',', col.names=c("ok","time","secs","lig")) # it gives time as factor
z <- cbind(x,colsplit(x$time, split="\\s", names=c("date", "clock")))
2011 Oct 10
1
calculate multiple means of one vector
Dear R-Users,
I have the following two vectors:
data <- rnorm(40, 0, 2)
positions <- c(3, 4, 5, 8, 9, 10, 20, 21, 22, 30, 31, 32)
now I would like to calculate the mean of every chunk of data-points (of the data-vector) as defined by the positions-vector.
So I would like to get a vector with the mean of element 3 to 5 of the data-vector, 8 to 10, 20 to 22 and so
2008 Feb 21
1
Save a group of matrix
Hello, I'm creating a loop to work with vegan, to get a species abundance curve. Here I send the script I've created and also an excel file to prove what it can do.
Well, I have a database with 20 years, and each year we have sampled 19 stratum, and in each estratum we have carry out some sumpling. Then, with the script that I've sent I've got to calculate the species abundance
2007 Aug 30
2
customizing the color and point shape for each line drawn using lattice's xyplot
Description of what I am trying to do:
I am using the xyplot code below to plot the variable ?MeanBxg? against the
variable ?PercentVarExplained? for all 9 possible combinations of variables
?bdg? and ?bdx?. Within each of these 9 scenarios I am plotting a separate
line for each of up to 9 different methods that I used to estimate the
variable MeanBxg. These methods are identified by the numeric
2010 Dec 10
0
[ANNOUNCE] libdrm 2.4.23
I've tagged a release for libdrm 2.4.23 principally to expose the new
kernel parameters for BLT support on SandyBridge and relaxed fencing which
are needed to build the next release of xf86-video-intel.
However, I'm lacking sufficient privileges to actually upload the tarballs
myself at the moment, so you'll have to make do with the git tag!
-Chris
Adam Jackson (1):