Hi,
You may want to check grid.arrange in gridExtra package.
Weidong
On Thu, Aug 9, 2012 at 7:36 AM, rodrock wrote:
> HI everybody!
>
> Has anybody figure out how would be possible to plot several ctree plots
> beside each other?
> I would really appreciate it
> My idea would be like this, but
Hi,
You can try predict.rpart in rpart package for prediction on a test data.
?predict.rpart
Weidong
On Thu, Jul 26, 2012 at 12:30 PM, Orla Carey wrote:
> Hello,
>
> I am running classification trees fro the purpose of predicting dividends.
> I have training and test data sets, but am running t
Sverre,
have you tried to put minus(-) in front of the variable by which you
order the other?
weidong
On Sun, Jul 22, 2012 at 12:27 PM, Sverre Stausland
wrote:
> reorder() is probably the best way to order the levels in a vector
> without manually specifying the order. But reorder() orders by d
Sorry, I meant Kolmogorov-Smirnov test.
Thanks Peter for correction.
Weidong
On Fri, Jul 13, 2012 at 4:56 PM, Peter Ehlers wrote:
> On 2012-07-13 13:33, Weidong Gu wrote:
>>
>> Hi Joerg,
>>
>> Seems Mann-Whitney-Wilcoxon test (ks.test in R) would do the work
>>
Hi Joerg,
Seems Mann-Whitney-Wilcoxon test (ks.test in R) would do the work
which tests differences anywhere in two distributions, e.g. tails,
interquartiles and center.
Weidong Gu
On Fri, Jul 13, 2012 at 7:32 AM, Schaber, Jörg
wrote:
> Hi,
>
> I have two non-normal distribution
Hi,
In my case, that was due to the existence of highly correlated
variables. see loggedEvents in the help file of mice.
Weidong Gu
On Sat, Jun 16, 2012 at 3:33 PM, b04877054 wrote:
> I have the same problem. How did you end up solving yours?
>
> --
> View this message in context:
how about
split(inpfil, paste(inpfil[,1],inpfil[,2],sep=','))
Weidong Gu
On Tue, Apr 3, 2012 at 6:42 PM, Ashish Agarwal
wrote:
> I have a dataframe imported from csv file below:
>
> Houseid,Personid,Tripid,taz
> 1,1,1,4
> 1,1,2,7
> 2,1,1,96
> 2,1,2,4
> 2,1,
You don't need temporary variable x
c<-f(1,2)[[1]]
d<-f(1,2)[[2]]
Weidong Gu
On Fri, Mar 30, 2012 at 6:40 PM, ivo welch wrote:
> Dear R wizards: is there a clean way to assign to elements in a list?
> what I would like to do, in pseudo R+perl notation is
>
> f <-
values. cross validation is used to
estimate the value of the turning parameter which gives the smallest
errors (mse or deviance) on testing data.
Weidong Gu
On Tue, Mar 27, 2012 at 10:35 AM, yx78 wrote:
> In the package lasso2, there is a Prostate Data. To find coefficients in the
> prostate
Your data set probably has character variables. You can transform them
into factors before running na.roughfix.
Weidong Gu
On Mon, Mar 26, 2012 at 8:17 AM, silje skår wrote:
> I have a question regarding NA in randomForest (in R). I have a dataset
> which include both numerical a
Hi,
This may help
a = c('one','two','three')
data.frame(eval(substitute(rbind(var,2),list(var=a))))
?substitute
?eval
Weidong Gu
On Sun, Mar 25, 2012 at 5:22 PM, Pedro Martinez
wrote:
> hello,
> I want to iterate through a list of names and use each el
is the method by aov) is a sequential
method. Therefore, order of variables in the model matters. For your
situation, you may want to use type II or type III SS (check Anova in
car) because they are estimates adjusted for other variables in the
model, thus order-independent.
Weidong Gu
On Thu, Mar
(data.test). It's not surprise the predictions are
different.
Weidong Gu
On Wed, Mar 21, 2012 at 2:35 PM, Juliet Hannah wrote:
> All,
>
> For my understanding, I wanted to see if I can get glmnet predictions
> using both the predict function and also by multiplying coefficients
Hi,
You can set na.action=na.roughfix which fills NAs with the mean or
mode of the missing variable.
Other option is to impute missing values using rfImpute, then run
randomForest on the complete data set.
Weidong Gu
On Sat, Feb 25, 2012 at 6:24 PM, kevin123 wrote:
> I am using the pack
stepAIC works for an object of clogit.
Weidong Gu
On Fri, Feb 17, 2012 at 2:10 AM, Subha P. T. wrote:
>
>
> Hi,
>
> Is there any function available to do stepwise selection of variables in
> Conditional(matched) logistic regression( clogit)? step, stepwise etc are
&g
Hi,
set scales=list(x=list(relation='free')) may help.
Weidong Gu
On Tue, Feb 7, 2012 at 6:42 AM, Florian Weiler wrote:
> Dear all,
>
> I have a question about the lattice package, more specifically about the
> control of the x-axis length in the different panels. I use t
Hi,
Since trt is a factor, you use it for indexing. try just delete in the code
fill <- my.fill[combined$trt[subscripts]]
Weidong Gu
On Fri, Jan 13, 2012 at 11:30 AM, matteo dossena wrote:
> #Dear All,
> #I'm having a bit of a trouble here, please help me...
> #I have this
Hi,
This might be due to the fact that factor levels are arbitary unless
they are ordinal, even that quantitative relationships between levels
are unclear. Therefore, the model has no way to predict unseen factor
levels.
Does it make sense to treat 'No_databases' as numeric instead of a
factor va
One simple option is to use confint function
exp(confint(result))
Weidong
On Tue, Dec 13, 2011 at 7:16 AM, 孟欣 wrote:
> Hi all:
> My data has 3 variables:
> age(3levels : <30y=1 30-50y=2, >50y=3)
> gender(Male=0, Female=1)
> CD4 cell count(raw lab measurement)
> y(1:death 0:alive)
>
> I perfor
Hi,
For imputation using randomForest package, check
?rfImpute
Weidong
On Fri, Dec 2, 2011 at 6:00 PM, Peter Langfelder
wrote:
> On Fri, Dec 2, 2011 at 2:16 PM, khlam wrote:
>> So I have a very big matrix of about 900 by 400 and there are a couple of NA
>> in the list. I have used the followi
urn an
> identical result to that used to generate the error rate for the final
> tree constructed??
>
> Sorry that is a bit long winded, but I hope someone can point out
> where I'm going wrong and set me straight.
>
> Thanks!
>
> On Sun, Nov 27, 2011 at 11:44 AM, Wei
Hi Matthew,
The error rate reported by randomForest is the prediction error based
on out-of-bag OOB data. Therefore, it is different from prediction
error on the original data since each tree was built using bootstrap
samples (about 70% of the original data), and the error rate of OOB is
likely h
Hi Fei,
I wouldn't worry to much about categorical variables for mice. Mice
would use logisitic regression for binary and polytomous logistic
regression for categorical variables with >2 levels. However, you
should not include factors with a lot of levels, saying>30, in
imputation models because i
Hi,
The significant interaction between A (continous) and B (categorical)
means that the slopes of Y in relation to A are different for classes
of B. Since your categorical B was binary, the default reference class
(B2) was intecept, and the slope of A for (B2) was 0.0017799. However,
the slope of
clogit needs to spell out formula plus strata, you can try modify the code
...
d2=d[,c(mols,'group','Age','strata')]
fo<-as.formula(paste(paste('group~','Age',sep=''),'strata(strata)',sep='+'))
log.reg<-clogit(fo,data=d2)
...
Weidong
On Mon, Nov 7, 2011 at 10:19 AM, 1Rnwb wrote:
> I would like t
Not sure this is valid that you can have 9 random samples out of 10,
but the last one has to be fixed to meet the restraint, sum=10.
Weidong
On Mon, Nov 7, 2011 at 5:22 PM, SarahJoyes wrote:
> Hey everyone,
> I am at best, an amateur user of R, but I am stuck on how to set-up the
> following sit
You should figure out how many samples you want for Y=1 and 0, then
sample from the relevant subset dfrm[dfrm$Y==1] by sampling
row.names(dfrm[dfrm$Y==1] using replace=FALSE
?sample
On Mon, Oct 31, 2011 at 8:18 PM, Comcast wrote:
>
>
> On Oct 31, 2011, at 1:54 PM, loubna ibn majdoub hassani
> w
For a data set dat with variable 'case', it follows
sam.rate=0.9
n.ctrl<-nrow(dat[dat$case==0,])
sam.ctrl<-dat[sample(row.names(dat[dat$case==0],n.ctrl*sam.rate,replace=F),]
rbind(dat[dat$case==1,],sam.ctrl)
Weidong Gu
On Mon, Oct 31, 2011 at 1:54 PM, loubna ibn majdoub hassani
One option is to use table to get the number of repeats
tab<-table(tr1$time)==3
time3<-names(tab)[tab]
tr1[tr1$time%in%time3,]
Weidong Gu
On Sun, Oct 30, 2011 at 5:10 PM, Zheng Lu wrote:
>
>
>
>
> With the following dataset, trl =1, 2,3, how to extract data with the tim
(xf), family = poisson, data = dat)
Coefficients:
(Intercept) as.numeric(xf)
1.59047 -0.02673
Weidong Gu
On Fri, Oct 28, 2011 at 4:21 PM, CES wrote:
> Hey all,
>
> I am attempting to replicate my results achieved in another program within
> R (so I can expand my op
;
> and the "fc" values are repeated over until the end of the rows and
> the "pv" is the same all across the samples...how can i fix it?!
>
> ...i apologize if it's a silly situation but i'm new to this and can't
> get my head around it!
>
>
ate it!!
>
> Sent from my -DROID-
>
> On Oct 26, 2011 6:56 PM, "Weidong Gu" wrote:
>>
>> If you provide an example data (y1 and y2 in the loop), you might have
>> got specific helps already. A few things in your loop seem suspicious.
>> fc and pv are vecto
If you provide an example data (y1 and y2 in the loop), you might have
got specific helps already. A few things in your loop seem suspicious.
fc and pv are vectors, and in each loop you redesigned the whole
vectors and specific indices twice. That may cause your problems.
Weidong Gu
On Wed
Check glmulti package for all subset selection.
Weidong Gu
On Wed, Oct 26, 2011 at 12:35 PM, RAJ wrote:
> Can I atleast get help with what pacakge to use for logistic
> regression with all possible models and do prediction. I know i can
> use regsubsets but i am not sure if i
package which conducts
model selection out of all potential combinations, even including
interactions if you don't have many variables.
HTH
Weidong Gu
On Mon, Oct 24, 2011 at 11:58 AM, MJS wrote:
> Hi All,
> Its a bit of a beginners question I'm afraid.
> I have a looped stepwis
This may work
obs.l<-sapply(input$observations,length)
desire.output<-data.frame(site=rep(1:6,obs.l),obs=unlist(input$observations))
Weidong Gu
On Sat, Oct 22, 2011 at 7:51 PM, Peter Meilstrup
wrote:
> The setup: I have a data frame where one column is in list mode, and
> each en
91.4119070
> 27 0.4 S 81.9875960
> 28 0.6 S 11.3183831
> 29 0.8 S 1.8843307
> 30 1.0 S 0.9310779
>
> for exemple, for the last line, I want aggregate to show me the number of
> lines with col1=1 and col2=S in stead of the mean
Is this waht you want?
sci[,5][sci[,2]==0 & sci[,1]==L]
Weidong
On Sat, Oct 22, 2011 at 8:19 AM, Adel ESSAFI wrote:
> Hi,
> It is not what I want, but, thx anyway.
> Regards
>
>
> 2011/10/22 Weidong Gu
>>
>> try this
>>
>> table(sci[,2]=0,sci[,1]=
try this
table(sci[,2]=0,sci[,1]=L)
Weidong Gu
On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI wrote:
> Hello,
> is there any help please.
> Regards
>
>
> 2011/10/21 Adel ESSAFI
>
>> Hello
>> I am discovering R and I find it is really very powerful.
>>
>
imputations are based
on some strong and untestable assumptions.
Weidong Gu
On Fri, Oct 21, 2011 at 12:13 PM, Rich Shepard wrote:
> Because of regulatory requirement changes over several decades and weather
> conditions preventing site access the variables in my data set have
> differen
Hi,
Just include pch=c(1,2,3), col=c('red','blue','yellow') or your
choices in xyplot
Weidong Gu
On Thu, Oct 20, 2011 at 2:15 PM, wisc_maier wrote:
> There have been posts in the past regarding similar questions, but many of
> them looked dated. I am using
Mike,
You can retrieve each of imputed data sets and use Rubin's rule for
combined analysis. I am not sure how to do combined analysis of cov,
but mean and SE would be estimiable.
For mi package to get individual copies of imputed data
?mi.completed
HTH
Weidong Gu
On Tue, Oct 18, 2011
It is good to provide the code but please make sure it is
reproducible? e.g. XZ is not defined in mgram(XY,XZ)?
Weidong Gu
On Sun, Oct 16, 2011 at 7:10 PM, Nevil Amos wrote:
> I would like to put confidence intervals on a mantel corellogram
> they are already calculated in the pmgram obje
if you set parameter simplify=TRUE, it returns a vector of the ragged
mean. In your case,
mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = TRUE)
df<-data.frame(ID=dimnames(mean_rating)[[1]], mean=mean_rating)
Weidong Gu
On Sun, Oct 16, 2011 at 9:53 AM, Helene Sc
If you want to draw the global regression line in each panel, you can try
xyplot(T~A|speaker,data=spk0,layout=c(4,5),type='p',groups=fns),
panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(lm(y~x,data=spk0))})
Weidong Gu
2011/10/16 조혜선 :
> I'd like to draw a lattic
On Fri, Oct 14, 2011 at 11:38 AM, Michael Friendly wrote:
> Hi all
> Consider the classic data below from Darwin on the heights of 15 pairs of
> zea mays (corn) plants
> either cross-fertilized or self-fertilized, where the goal is to see if it
> makes a difference.
>
>> head(ZeaMays)
> pair pot
?tolower
Weidong Gu
On Fri, Oct 14, 2011 at 12:12 PM, Jose Bustos Melo wrote:
>
>
> Hello everyone,
>
> I'm trying to change the name variables of a big dataset. Here's more than
> 300 variables. The point is that I have to match it with another dataset that
&
It would be nice if you could provide a sample. However, if the data
in the list have the same colnames, you can combine them by
df<-do.call('rbind',your_list_data_frame)
Then you can do what you want on the dataframe instead of a list
HTH
Weidong Gu
On Fri, Oct 14, 2011 at 9:
Because SpatialPointsDataFrame is S4 object, you may try index by @
e@coords
or coordinates(e)
Weidong Gu
On Thu, Oct 13, 2011 at 2:18 PM, Bailey, Daniel wrote:
> Michael,
> Thank you for the tips. The suggestion didn't work though. Here is the output
> of str(e):
try
hist(gender$HeartRate,main='Histogram: HeartRate distribution for
Temperature Data')
Weidong Gu
On Wed, Oct 12, 2011 at 8:44 PM, Jonathan Edwin wrote:
> Hi all,
>
> Mind my ignorance and complete newbiness, but I am very new to R and am
> currently learning it thro
It's better to avoid loop in this situation. If you want to reorder
subsets of the data based on event, the follow works
df<-read.table('clipboard',header=TRUE)
sp.or<-lapply(split(df,df$group),function(ldf) ldf[order(ldf$event),])
new.df<-do.call('rbind',sp.or)
Maybe it was caused by your modeling binary variable using lm rather than glm.
Weidong Gu
On Wed, Oct 12, 2011 at 9:59 AM, anamiguita wrote:
> Hey,
>
> I need some help.
>
> I want to obtain a cross validation for a regression model (binary response)
> but I got an error wit
In your case, it may not be sensible to simply fill missing values by
mean or mode as multiple imputation becomes the norm this day. For
your specific question, na.roughfix in randomForest package would do
the work.
Weidong Gu
On Tue, Oct 11, 2011 at 8:11 AM, francesca casalino
wrote:
> Dea
An ad-hoc method is to impute missing scores of the whole data set
including subgroup1, then change imputed scores in subgroup1 into NA.
Weidong Gu
On Mon, Oct 10, 2011 at 5:35 AM, Sarah wrote:
> Dear R-users,
>
> I want to multiple impute missing scores, but only for a few subgro
pair-wise comparison, you need post-hoc testing methods
(?TukeyHSD).
HTH
Weidong Gu
On Wed, Oct 5, 2011 at 1:55 PM, Chris Mcowen wrote:
> Dear list,
>
> I am unsure how to structure my model, i have tried something and it makes
> sense but i am unsure if i am interpreting it corr
Seems your questions belong to rule mining for frequent item sets.
check arules package
Weidong Gu
On Tue, Sep 27, 2011 at 11:13 PM, pip56789 wrote:
> Hi,
>
> I have a few methodological and implementation questions for ya'll. Thank
> you in advance for your help. I have a data
A sample data would help. But you could modify as
text(x,y, label = row.names(colon[1:20,]))
HTH
Weidong Gu
On Tue, Sep 20, 2011 at 7:43 PM, baumeist wrote:
> Hi,
> I am new to R.
>
> I have a matrix that I have assigned to the object “colon”.
>
>> colon<-read.table
If different labs tested different tissue.types, I am not sure you can
effectively partition variance between labs(batches) and tissue.types.
Weidong Gu
On Tue, Sep 20, 2011 at 2:14 PM, karena wrote:
> Hi,
>
> I am doing an analysis to see if these is tissue specific effects on t
Remember R is object-oriented. Your m is lm object, so check
?plot.lm
Weidong Gu
On Thu, Sep 15, 2011 at 8:14 PM, Idris Raja wrote:
> Sample code from *R CookBook* (awesome book btw) *11.12: Finding the Best
> Power Transformation (Box-Cox) Procedure*
>
> require(MASS)
> x
ent the counter
}
}
Weidong Gu
On Wed, Sep 14, 2011 at 5:36 PM, Fred wrote:
> Dear forum,
>
> I would like to forecast e.g. with the arima-model. To figure out which
> model works best I am going to predict with this models.
>
> my first code:
>
> for(ar.ord in 1:3)
This can be done using bwplot in lattice library. Also, it is better
to organize your data in 'long' format. Look at functions reshape or
melt in reshape library.
Weidong Gu
On Thu, Sep 1, 2011 at 12:10 PM, Jie TANG wrote:
> hi
>
> i have a dataframe with the name "obsd
line where the character locates. Then, you can
specify skip in read.table to input your data.
HTH
Weidong Gu
On Tue, Aug 30, 2011 at 10:23 PM, Julius Tesoro wrote:
> Dear All,
>
>
> I have many files with a lot of headers and text at the beginning of the
> file. The headers
nrow and ncol
for (i in 1:3) {
group.v[i,]<-names(d)[grep(LETTERS[i],names(d))]
df[i]<-d[,names(d)%in% group.v[i]]
}
Weidong Gu
On Tue, Aug 30, 2011 at 2:31 PM, Hui Du wrote:
>
> Hi All,
>
> I have a data frame, whose colnames like "A.x, B.x, C.x, A.y,
How about to add a conditional statement to get the header from 1st file
for(i in all.files) {
if (i==all.files[1]) new.data <- read.table(i,header=TRUE) else {
new.data <- rbind(new.data, read.table(i))}}
Weidong Gu
On Tue, Aug 30, 2011 at 1:42 PM, Vining, Kelly
wrote:
> Hello
? predict.rpart
Weidong Gu
On Mon, Aug 29, 2011 at 12:49 PM, Jay wrote:
> Hi,
>
> when I have made a decision tree with rpart, is it possible to "apply"
> this tree to a new set of data in order to find out the distribution
> of observations? Ideally I would like to pl
Andra,
You can transfer the probabilities into class membership by setting up
a cut-off value, usually 0.5.
set.seed(3)
x<-rnorm(100)
y<-rbinom(100,prob=1/(1+exp(x)),size=1)
model<-glm(y~x,family=binomial(link=logit))
pred<-ifelse(predict(model,type='response')>0.5,1,0
At default, factors (months) are alphabetically leveled. You can
explicitly re-level months
months<-factor(months,levels=c('Jan','Feb','Mar',...,'Dec'))
Then it should work.
Weidong Gu
On Wed, Aug 24, 2011 at 10:45 AM, Phoebe Jekielek wrote:
> H
You can do something like this
sp<-split(dat, list(dat$Vial,dat$Site))
seq.model<-lapply(sp, function(x) lm(x$InRFU~x$Time))
Then, extract whatever you want from seq.model
Weidong Gu
On Mon, Aug 22, 2011 at 9:15 PM, Nathan Miller wrote:
> Hi all,
>
> I have a data set t
in the places of pch in your codes of dotplot and key
HTH
Weidong Gu
> My code so far is as follows:
>
> ## initalise
> library("lattice")
>
> ##read the data to a variable
> Cal_dat <- read.table("Calibration2.dat",header = TRUE,sep = "\t"
You may want to consult a recent post by Felix
(https://stat.ethz.ch/pipermail/r-help/2011-August/286707.html) on how
to pass group parameter.
Weidong Gu
On Sat, Aug 20, 2011 at 6:59 AM, Sébastien Bihorel wrote:
> Dear R-users,
>
> A while ago, Deepayan Sarkar suggested some code that
It is most likely due to your ordering of y values. You need to write
key manually to reflect the change. Without providing reproduciable
data, you may not get specific help.
Weidong Gu
On Fri, Aug 19, 2011 at 6:23 PM, markm0705 wrote:
> Dear R-help members. I am an 'R-learner' (
check
?cor
Please note the parameter 'use'
Weidong Gu
On Sat, Aug 13, 2011 at 9:06 AM, Julie wrote:
> Hello,
> I am quite new to R and I am trying to get a round correlation from a table
> with dozens of columns. However, all the columns contain several blank
> places w
On Fri, Aug 12, 2011 at 5:08 PM, Katrina Bennett wrote:
> Hi Weidong Gu,
>
> This works! For my clarity, and so I can repeat this process if need be:
>
> The 'mat' generates a matrix using whatever is supplied to x (i.e.
> coop.dat) using the columns from position
exactly what you want.
Weidong Gu
On Fri, Aug 12, 2011 at 2:35 AM, Katrina Bennett wrote:
> Hi R-help,
>
> I am working with US COOP network station data and the files are
> concatenated in single rows for all years, but I need to pull these
> apart into rows for each day. To do t
Mike,
One thing I noticed that '&&' should be replaced by '&'. The former is
applied to the first element of the vector while the latter applicable
to the whole vector.
HTH
Weidong Gu
On Wed, Aug 10, 2011 at 7:34 PM, Ward, Michael Patrick
wrote:
>
> I us
?predict.rpart
Weidong Gu
On Mon, Aug 8, 2011 at 6:08 PM, Jose Bustos Melo wrote:
> Hello Everyone,
>
> I'm doing a Classification trees with categorical explanatory variables using
> library rpart and I would like to do a prediction for some data imputs. I
> don't k
)-dta$x/2,1.3,labels=as.character(dta$y))
})
Weidong Gu
On Wed, Aug 3, 2011 at 9:01 PM, M/K Zodet wrote:
> All:
>
> Below is my code for creating a basic horizontal, stacked barchart. I'd like
> to label the plot in two ways: 1) place the x values in each piece and 2)
> place the
Hi Simon,
Is this what you want?
mydat$cum.news<-unlist(tapply(mydat$news,mydat$state,FUN=cumsum))
Weidong Gu
On Sat, Jul 23, 2011 at 7:11 AM, Simon Kiss wrote:
> Dear colleagues, I have a data set that looks roughly like this;
> mydat<-data.frame(state=c(rep("Alabama",
Sarath,
Maybe someone can show a direct access to the statistic. One way to
get around is to access 't' component of the boot object which
contains individual estimates. so you can extract standard error by
sqrt(var(bootObj$t))
Weidong Gu
On Fri, Jul 22, 2011 at 11:36 AM, Sar
I didn't see bootstrap steps in your code. One way to modify your codes
for (Ncount in 1:100)
{
b.data<-data[sample(1:nrow(data),replace=T),]
y <-b.data[,1]
x <-b.data[,2]
n <- length(x)
... ### make appropriate changes if needed
}
Weidong Gu
On Wed, Jul 20, 2011 at 6:09 PM,
Sarah,
You can try this
mean(sapply(1:n.imp, function(x) complete(imp,x)$y))
Weidong Gu
On Wed, Jul 20, 2011 at 6:05 AM, Sarah wrote:
> Hi all,
>
> How can I calculate the mean from several imputed data sets with the package
> mice?
> I know you can estimate regression param
You can do it by subsetting or indexing
r<-c(0,0,0,rnorm(10,10,5))
> mean(r)
[1] 8.052215
> mean(r[r!=0])
[1] 10.46788
Weidong Gu
On Tue, Jul 19, 2011 at 4:36 PM, Dimitri Liakhovitski
wrote:
> Sorry if it's been discussed before - don't seem to find it.
> I'd
Hi,
In your loop, change Corrs[i] to Corrs[i,]
Weidong Gu
On Sat, Jul 16, 2011 at 12:02 PM, EdBo wrote:
>> t
> Hi
>
> I have to matrices t and y below. I want correlation of columns (a,d) (b,e)
> and (c,f). The correlation should be for the first 3 rows of matrix t
>
If I understood your question
x<-data.frame(matrix(rnorm(2000,10,10),ncol=50))
sapply(1:5,function(i) summary(lm(x[,i]~x[,i+10]+x[,50])))
Weidong Gu
On Thu, Jul 14, 2011 at 2:27 PM, Jon Toledo wrote:
>
> Hi,
> First let me thank you for the incredible help and resource that this
You may need panel function
spplot(enaD2, "var1.pred",sp.layout=pts, main = "globina 60 cm",
sub="D2", col.regions=terrain.colors(64), contour=T,
panel = function(x,y,z,subscripts,...) {
panel.polygonsplot(x,y,z,subscripts,...)
sp.text(coordinates(enaD2), enaD2$ime
One way around hacking rpart is to write code to do K fold samples
based on unit outside rpart, then build trees using training sets and
summarize scores on testing sets.
Weidong Gu
On Mon, Jul 4, 2011 at 9:22 AM, Katerine Goyer wrote:
>
>
>
>
>
>
>
> Hello,
>
&
another way of thinking is to turn the sequences into strings
if your data is db
>apply(db,1,function(x) length(gregexpr('892',paste(c(x),collapse=''))[[1]]))
[1] 1 3 1 1 3 2
Weidong Gu
On Sat, Jul 2, 2011 at 3:40 PM, Trying To learn again
wrote:
> Hi all,
>
you can do something like this
x<-rnorm(20,0,1)
time=c(1,2,3)
sapply(1:length(time),function(t) sample(x,time[t]))
Weidong Gu
On Fri, Jun 17, 2011 at 9:59 AM, alfredo wrote:
> Hi All,
>
> I'd like to randomly sample a vector N times, where each successive random
> sample
this may work.
X<-data.frame(sapply(X,function(x) as.factor(x)))
reg3=lm(Y~.,data=X)
dummy.coef(reg3)
Weidong Gu
On Sun, Jun 12, 2011 at 4:55 PM, Robert Ruser wrote:
> Hi,
> but I want to get the coefficients for every variables from x1 to x5.
> (x1 was an example)
>
> Ro
for categorical independent variables, regression models in R will
generate dummy indicators based on your setting of contrasts (default
contr.treatment). Use model.matrix(your model) to see how R does this
internally.
Weidong Gu
On Sun, Jun 12, 2011 at 2:38 AM, setlist wrote:
> Hello, I wan
Is this what you want?
sapply(sapply(strsplit(as.character(f1$keyword),' '),nchar),sum)
Weidong Gu
On Fri, Jun 10, 2011 at 1:25 PM, Jorge Ivan Velez
wrote:
> Hi Abraham,
>
> Try
>
> foo <- function(x){
> x <- as.character(x)
> sapply(strsplit(x, " &
Erin,
?merge
Try
c.df=merge(a.df,b.df,by.x="PATIENT_ID",by.y="ID")
hope it helps
Weidong
__
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
a
this way, instead it plots addtions of the two
columns. I changed allow.multiple with no success.
Your help is appreciated.
Weidong Gu
Department of Medicine
University of Alabama, Birmingham
__
R-help@r-project.org mailing list
https://stat.ethz.ch
nd the problem?
Thanks in advance
Weidong Gu
Department of Medicine
UAB
__
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 comm
Hi Bert,
Thanks for your prompt response. Yeah, summary() shows the correct
answer, seemingly, plot() and text() reverse the direction of >= sign, a
bit confusion.
Weidong Gu
-Original Message-
From: Bert Gunter [mailto:gunter.ber...@gene.com]
Sent: Monday, February 23, 2009 5:14
+Deterrence)) indicates that Mortality
was positively related to Incidence.
How this unintuitive result? Advice is appreciated.
Weidong Gu,
Department of Medicine
University of Alabama, Birmingham
Deterrence Mortality Incidence
0.695 0.5166
0.255 0.501 48
0.612 0.483 55
0.209
all without success. So, your help
would be appreciated.
Weidong Gu
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
Email: [EMAIL PROTECTED]
PH: (205)-975-9053
Site Pool Positivity
UBA_1
22
0
UBA_1
50
0
UBA_1
23
0
? order
df<-data.frame(a=rnorm(20),b=rpois(20,5),c=runif(20))
or<-order(df$b,decreasing=T)
df.or<-df[or,]
Weidong Gu
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
-Original Message-
From: [EMAIL PROTECTED] [mail
?gsub()
Match the start (_) followed by anything (.*) and replace by ""
gsub("_.*","",Name)
Weidong Gu,
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
PH: (205)-975-9053
-Original Message-
F
?na.omit
Weidong Gu,
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
Email: [EMAIL PROTECTED]
PH: (205)-975-9053
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Charles Vetterli
Sent: Monday
1 - 100 of 109 matches
Mail list logo