# build off of david's suggestion
x <-
data.frame(
patient= 1:20 ,
disease =
sapply(
pmin( 2 + rpois( 20 , 2 ) , 6 ) ,
function( n ) paste0( sample( c('A','B','C','D','E','F'),
n), collapse="+" )
)
)
# break the diseas
Dear Community,
I emphasize the use of graphical methods to examine residuals for a Panel
model and want to plot the Standard Deviation of residuals by group.
I used the following for plotting residuals by group:
>library(lattice)
>xyplot((residuals(fixed.reg1.1))~countrynr,data=data.plm
Hi,
I have a matlab variable as serial date (class double) in the form
'dd-mmm- HH:MM:SS'.
format long
disp( tx(40:60,1) )
1.0e+05 *
7.35600813091
7.35600956856
7.35601305921
7.35601654985
7.35602004049
7.35602353113
7.35602702178
7.356000
Greg - I appreciate your taking the time to explain. This is very
helpful. My case was a bit unusual as I'm helping a colleague with code
to use on a regular but individual basis. I want them to name a data set
once at the top of the script and have that name propagate through
several objects t
Seems to me you are creating your own troubles in your "requirements". If the
analysis is the same from case to case, it makes more sense to use a single set
of object names within the analysis and change only the names of the input and
output files.
-
... and wrap it all up into a single function call that could even
have the user interactively supply the input data file names.
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisd
See ?as.Date.
I am guessing these are days and fractional days. Try
x <- 7.35600813091e5
as.POSIXct((x - 719529)*86400, origin = "1970-01-01")
On 25/06/2014 14:56, Christoph Schlächter wrote:
Hi,
I have a matlab variable as serial date (class double) in the form
'dd-mmm- HH:MM:SS'
I think the character format for this data is the most versatile and clear
option. You do have to prevent the R input function (read.csv? read.table?)
from converting it to factor when you read it in, but then you can use
as.POSIXct with a format argument (see ?strptime) to obtain useful timesta
Hi,
Check if this works:
set.seed(495)
dat <- data.frame(ID=sample(1:10,20,replace=TRUE),
Disease=sample(LETTERS[1:6], 20, replace=TRUE) )
subset(melt(table(dat)[rowSums(!!table(dat))>1,]), !!value,select=1:2)
ID Disease
1 2 A
3 4 A
4 6 A
6 10 A
8 3
Hi,
May be this helps:
dat <- read.table(text="7.35600813091
7.35600956856
7.35601305921
7.35601654985
7.35602004049
7.35602353113
7.35602702178
7.35603397179
7.35604092182
7.35604787183
7.35605482185
7.35606177187
7.35606
Hello
I have a question on how to perform a Duncan test after I set a model like this
(see below).
The data consist of a dependent variable (PHt) and two dependent variables
(REGION (3 levels) AND MANAGEMENT (3 levels)).
MANAGEMENT
N PS
REGION A 196 196
Also, you can do:
library(dplyr)
dat%>%group_by(ID)%>%filter(length(unique(Disease))>1)%>%arrange(Disease,ID)
A.K.
On Wednesday, June 25, 2014 3:45 AM, arun wrote:
Forgot about:
library(reshape2)
On , arun wrote:
Hi,
Check if this works:
set.seed(495)
dat <- data.frame(ID=sample
Dear Amber,
your data contains missing values and you don't use surrogate splits to
deal with them. So, the observations are passed down the tree randomly
(there is no "majority" argument to "ctree_control"!) and thus it might
happen that too small terminal nodes are created.
Simply use sur
You didn't say which package Duncan.test is in. glht has the ability.
glht, and probably any other package's test, cannot work with aovlist objects.
They require aov objects. That means you must rewrite your Error() statement
into the main model. Please see the entire maiz example in ?mmc to see
So my company has hired a few young McKinsey guys from overseas for a
couple of weeks to help us with a production line optimization. They
probably charge what I make in a year, but that's OK because I just
never have the time to really dive into one particular time, and I have
to hand it to the co
It is called sample(,replace=F), where the default argument is sampling
without replacement.
Try
x <- c("A","B","C","D","E")
sample(x)
Brian
Brian S. Cade, PhD
U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO 80526-8818
email: ca...@usgs.gov
tel:
On Jun 24, 2014, at 11:18 PM, Abhinaba Roy wrote:
> Hi David,
>
> I was thinking something like this:
>
> ID Disease
> 1 A
> 2 B
> 3 A
> 1C
> 2D
> 5A
> 4B
> 3D
> 2A
> ....
>
> How can this be done?
do.call(rbind, lapply( 1:20, function(pt) {
I think Robert wants deterministic permutations. In the e1071
package -- load with library(e1071) -- there is a function
permutations():
Description:
Returns a matrix containing all permutations of the integers
'1:n' (one permutation per row).
Usage:
permutations(n)
Arguments:
n: N
The TERR team will be at useR 2014, June 30th to July 3rd, to share
the latest enhancements and news around TIBCO Enterprise Runtime for
R. In addition to providing demos at the TIBCO TERR table in the
exhibition area, some of the senior members of the TERR team will be
presenting at the conference
Assuming you want all of the permutations not just a random permutation (such
as sample() give you):
> require(e1071)
> indx <- permutations(5)
> head(indx)
[,1] [,2] [,3] [,4] [,5]
[1,]12345
[2,]21345
[3,]23145
[4,]132
and further...
See ?Recall for how to do recursion in R.
However, it is my understanding that recursion is not that efficient
in R. A chain of function environments must be created, and this does
not scale well. (Comments from real experts welcome here).
Cheers,
Bert
Bert Gunter
Genentech Noncl
A couple of typos in the last section. It should be
> perm.ltrs <- apply(indx, 1, function(x) paste(LETTERS[x], collapse=" "))
> tail(perm.ltrs)
[1] "E D A B C" "E D B A C" "E D B C A" "E D A C B" "E D C A B" "E D C B A"
> tail(perm.ltrs)
[1] "E D A B C" "E D B A C" "E D B C A" "E D A C B" "E D C
The brokenness of your perm.broken function arises from the attempted use
of sapply to bind matrices together, which is not something sapply does.
perm.fixed <- function( x ) {
if ( length( x ) == 1 ) return( matrix( x, nrow=1 ) )
lst <- lapply( seq_along( x )
, function( i )
sorry... editing on the fly... try:
perm.fixed <- function( x ) {
if ( length( x ) == 1 ) return( matrix( x, nrow=1 ) )
lst <- lapply( seq_along( x )
, function( i ) {
cbind( x[ i ], perm.fixed( x[ -i ] ) )
}
)
do.call( rbind
Hello All
I intend to plot a 3-D marked point process. Could you please help me to find a
code or a related package?
Thanks
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
I am trying to plot data that I imported with read. table using a Weibull
distribution. Here's the code I used for importing the data:
data <- read.table(file =
"C:/Users/Steven/OneDrive/Unfiled/Temp/phase2.csv", header = FALSE, sep = ",",
dec = ".", col.names = c("cycle_time", "cycle_length", "
I’d start trying to understand the error message - it is actually pretty clear
(see ?curve).
I suspect curve is not the function you want to use, rather something like
plot(data$arrival_time, dexp(data$arrival_time, rate=0.06), xlim = c(0, 60),
type=‘l’, main = "Exponential distribution”)
assu
Ferra Xu yahoo.com> writes:
>
> Hello All
>
> I intend to plot a 3-D marked point process.
> Could you please help me to find a code or a related package?
How about scatterplot3d or rgl::plot3d ?
Googling "r 3d point plot" gets you a lot of good starting points.
(The easiest way to indicate t
I am wondering if I want to model a space-time non-homogeneous Poisson process
that has more probability of occurrence in some areas in space, how should I do
that? For example we want to model the intensity function of earthquake
occurrence that is more probable to happen in some areas (around
29 matches
Mail list logo