Displaying 20 results from an estimated 300 matches similar to: "How to order an data.table by values of an column?"
2009 Jun 25
2
How to draw a line in plot when I know the start point(x1, y1) and end point(x2, y2)?
Hello all,
How to draw a line in plot when I know the start point(x1,y1) and end point(x2,y2)? I need make this as additional information in the graph:
plot(wl2[[1]],wl2[[2]])
I think that is possible make this with the function abline(), is possible? I looked the function lines() too, but don't understand as make.
Thanks!
Lesandro
Veja quais são os assuntos do momento no Yahoo!
2009 Jun 11
2
How to force R to print 2 decimal places in column of a data.frame?
How to force R to print 2 decimal places in column of a data.frame? I tried to do so:
x = inp(format(rounf(inp$Tamanho, 2), nsmall = 2),)
where "INP" is data.frame and "Size" is the name of column. But has error:
Error in eval.with.vis(expr, envir, enclos) :
could not find function "inp"
Lesandro
Veja quais s?o os assuntos do momento no Yahoo! +Buscados
2013 Jan 06
4
random effects model
Hi A.K
Regarding my question on comparing normal/ obese/overweight with blood
pressure change, I did finally as per the first suggestion of stacking the
data and creating a normal category . This only gives me a obese not obese
14, but when I did with the wide format hoping to get a
obese14,normal14,overweight 14 Vs hibp 21, i could not complete any of the
models.
This time I classified obese=1
2008 Oct 15
1
Parameter estimates from an ANCOVA
Hi all,
This is probably going to come off as unnecessary (and show my ignorance)
but I am trying to understand the parameter estimates I am getting from R
when doing an ANCOVA. Basically, I am accustomed to the estimate for the
categorical variable being equivalent to the respective cell means minus the
grand mean. I know is the case in JMP - all other estimates from these data
match the
2007 May 18
4
Simple programming question
Hi R-users,
I have a simple question for R heavy users. If I have a data frame like this
dfr <- data.frame(id=1:16, categ=rep(LETTERS[1:4], 4),
var3=c(8,7,6,6,5,4,5,4,3,4,3,2,3,2,1,1))
dfr <- dfr[order(dfr$categ),]
and I want to score values or points in variable named "var3" following this
kind of logic:
1. the highest value of var3 within category (variable named
2002 May 16
1
glm(y ~ -1 + c, "binomial") question
This is a question about removing the intercept in a binomial
glm() model with categorical predictors. V&R (3rd Ed. Ch7) and
Chambers & Hastie (1993) were very helpful but I wasn't sure I
got all the answers.
In a simplistic example suppose I want to explore how disability
(3 levels, profound, severe, and mild) affects the dichotomized
outcome. The glm1 model (see below) is
2010 Nov 24
2
Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?
Hi all,
Is there an equivalent to predict(...,type="linear") of a Proportional hazard
model for a Cox model instead?
For example, the Figure 13.12 in MASS (p384) is produced by:
(aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ +
pspline(age, df=6), data = Aidsp))
zz <- predict(aids.ps, data.frame(state = factor(rep("NSW", 83), levels =
2011 Jun 23
2
Rms package - problems with fit.mult.impute
Hi!
Does anyone know how to do the test for goodness of fit of a logistic model (in rms package) after running fit.mult.impute?
I am using the rms and Hmisc packages to do a multiple imputation followed by a logistic regression model using lrm.
Everything works fine until I try to run the test for goodness of fit: residuals(type=c("gof"))
One needs to specify y=T and x=T in the fit. But
2009 Oct 29
3
Removing & generating data by category
Dear R users,
Basically, from the following arbitrary data set:
a <-
data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4)))
> a
2011 Aug 28
1
Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
Dear developers,
I have jutst started working with caret and all the nice features it offers. But I just encountered a problem:
I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor).
Everything was working fine I got the results, confussion matrix etc.
BUT for obtaining the AUC and predicted probabilities I had to add
2013 Aug 29
4
Add new calculated column to data frame
Hi,
I have a following data set:
id event time (in sec)
1 add 1373502892
2 add 1373502972
3 delete 1373502995
4 view 1373503896
5 add 1373503996
...
I'd like to add new column "time on task" which is time elapsed between two
events (id2 - id1...). What would be the best approach to do that?
Thanks,
Srecko
[[alternative HTML
2006 Sep 03
1
Beranger: Updating to CentOS 4.4: Possible Issues and Small Hints
<http://beranger.org/index.php?categ=17&offset=0>, but nothing
specific about the named/bind showstopper.
rgds/ldv
2013 Feb 17
6
histogram
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2011 May 05
4
Using functions/loops for repetitive commands
I still need to do some repetitive statistical analysis on some outcomes
from a dataset.
Take the following as an example;
id sex hiv age famsize bmi resprate
1 M Pos 23 2 16 15
2 F Neg 24 5 18 14
3 F Pos 56 14 23 24
4 F Pos 67 3 33 31
5 M Neg 34 2 21 23
I want to know if there are statistically detectable differences in all of
the continuous variables in
2005 Jul 18
1
Survival dummy variables and some questions
Hi All,
I am currently conducting some survival analyses. I would like to
extract coefficients at each level of the IVs.
I read on a previous posting that dummy regression using coxph was not
possible.
Therefore I though, hey why not categorize the variables
(I realize some folks object to categorization but the paper I am
replicating appears to have done so ...)
and turn the variables
2007 Feb 02
1
R syntaxe
Hi all,
Suppose I have a vector x with numerical values.
In y, I have a categorial variable : y<-c(1,1,..2,2,...30,30,30)
x and y have the same length.
I would like to compute the mean for x for the modality 1 to 30 in y.
mean(x[y==1]),...,mean(x[y==30])
I do not want to use an iterative procedure such that for (i in 1:30)..
Thanks for your help,
Regards.
Olivier.
--
2009 Jul 09
3
Stratified data summaries
Hi All,
I'm trying to automate a data summary using summary or describe from the
HMisc package. I want to stratify my data set by patient_type. I was
hoping to do something like:
Describe(myDataFrame ~ patient_type)
I can create data subsets and run the describe function one at a time,
but there's got to be a better way. Any suggestions?
Rachel
[[alternative HTML
2012 Dec 28
3
help with reshaping wide to long format
Hi, Sorry, but how did you bring it out?
Thanks
On Fri, Dec 28, 2012 at 8:48 AM, arun kirshna [via R] <
ml-node+s789695n4654093h10@n4.nabble.com> wrote:
> Hi,
> bp.sub<- structure(list(CODEA = c(1L, 3L, 4L, 7L, 8L, 9L, 10L, 11L, 12L,
> 13L, 14L, 16L, 17L), C45 = c(NA, 2L, 2L, 2L, 2L, 1L, NA, 1L,
> 1L, 2L, 1L, 2L, 1L), ragek = c(3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L,
> 3L, 3L,
2008 May 05
3
troubles with R CMD check and examples under Ubuntu gutsy
Dear listers,
I was used to package pgirmess under Windows with everything OK, but,
for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I
have a double boot computer and work more and more under unix) and R
2.7.0. Everything went OK except this:
sudo R CMD check pgirmess
.....
* checking examples ... ERROR
Running examples in 'pgirmess-Ex.R' failed.
The error most
2012 Oct 04
3
"Explore" SPSS function in R
Hi everyone,
Does anybody knows if there is an equivalent R function that gives the same
outcome as in "Explore" function in SPSS ?
(Analize->Descriptive Statistics->Explore)
It does a categorical vs quantitative variables analysis. ( But not linear
regression)
I need to compare intragroup (categorical variable with 4 values) means and
confidence intervals of a quantitative