Re: [R] Classification Tree Prediction Error

2020-08-25 Thread Xu Jun
Breathed in his "Bloom County" comic strip ) > > > On Mon, Aug 24, 2020 at 8:58 AM Xu Jun wrote: > >> Dear all R experts, >> >> I have a question about using cross-validation to assess results estimated >> from a classification tree model. I annotated

[R] Classification Tree Prediction Error

2020-08-24 Thread Xu Jun
because I have too few variables? Thanks a lot! Jun Xu, PhD Professor Department of Sociology Ball State University Muncie, IN 47306 USA Using the estimates, I get the following prediction rate (correct prediction) using the test set. Or we can say the misclassification error rate is 1-0.837 = 0.1

[R] Help on MFAmix to Reduce Dimensions for a Genetic Dataset

2019-07-05 Thread Xu, Bingze
know much about the genetic dataset and I do not want to remove the columns even if those two columns are identical, what can I do next? Thank you very much and I look forward to your reply. Best wishes, Bingze Xu Graduate Student - M.S. in Business Analytics Washington University in St. Louis

[R] How to rotate label in tcltk R

2018-08-17 Thread Zehao Xu
Dear sir (ma'am) I just start the tcltk in R. I face a problem, how to rotate the labels in tcltk? I post the example on https://stackoverflow.com/questions/51825771/how-to-rotate-labels-in-tcltk. Thank you Z Xu [[alternative HTML version de

[R] Can I use tabu search for minimization problem ?

2017-06-20 Thread Mars Xu
Hi all, I want to use tabu search to solve my minimization problem. but tabu search in R is for maximization, so I turn my function from f to -f, but the eUtilityKeep always be 0 from the second position. I have go through a part of source code found that it always give the default value

[R] Manova: Data similarly generated are significantly different.

2015-09-04 Thread Roger Xu
Dear R users, Hi. I don't know if my understanding of Manova test is correct. So I test with the following code and got strange results. Any help would be appreciated. y0, y1, and y2 are independently generated by the same method. They are each split into 20 groups by the same method. The summa

[R] Rearrange Data Frame

2015-07-29 Thread Stella Xu
My question is about how to select and rearrange the data to a new data frame Here is an example: Samples counts time A 10 3 A 12 4 A 11 3 B 12 4 B 10 5 C

[R] How to show the color bar legend in R?

2015-01-22 Thread Ferra Xu
Based on the dataset, I computed a 3D kernel (longitude, latitude, depth) and displayed the magnitude with the sphere radius and time with color as follows. I am wondering how I can show the color bar legend. Also I have problem with the scale of the graph. I need to see if the balls touch or o

Re: [R] pamr.train()

2015-01-20 Thread Jia Xu
___ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-co

Re: [R] Fine Tuning Parameters for LogReg in Caret

2014-10-24 Thread Jia Xu
; and provide commented, minimal, self-contained, reproducible code. > -- Jia Xu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

Re: [R] Caret and Model Prediction

2014-10-06 Thread Jia Xu
outcomes for each set of features, should I then train 5 different > models (one for each of them)? > Cheers > > Lorenzo > > > On Sun, Oct 05, 2014 at 11:04:01AM -0700, Jia Xu wrote: > >> Hi, Lorenzo: >> For 1) I think the formula is not correct. The formula sh

Re: [R] Caret and Model Prediction

2014-10-05 Thread Jia Xu
t; > Many thanks > > Lorenzo > > ______ > 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 commented,

[R] rgl.postscript doesn't show the colors correctly

2014-07-28 Thread Ferra Xu
I wrote this code in R, in order to plot a density function kernel smoothing and then save the plot as a "eps" file: library(ks)  library(rgl) kern <-read.table(file.choose(),sep=",") hat <-kde(kern) plot(hat,drawpoints=TRUE,xlab ="x",ylab="y",zlab="z")  rgl.postscript("plot1.eps","eps",drawTex

[R] Kernel smoothing density function

2014-07-24 Thread Ferra Xu
Hello all, In order to find the kernel smoothing density function of a 3 dimensional data-set, I wrote this code in R: library(ks)defect <-read.table(file.choose(),sep=",")hat <-kde(defect)pdf("SampleGraph.pdf")plot(hat,drawpoints=TRUE)dev.off() But I have problem in interpretation of the result.

[R] Generate data follows space-time clustered inhomogeneous Poisson point process in 3D space

2014-06-27 Thread Ferra Xu
I'd like to know how can I generate a data set for space-time clustered  inhomogeneous Poisson processin a 3D space without having any previous data in R? Actually I need to generate points in a rectangle cube, and these points are not uniformly distributed in space (they show clusters). Thanks,

[R] Space-time non-homogeneous Poisson process

2014-06-25 Thread Ferra Xu
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

[R] plot a 3-D marked point process

2014-06-25 Thread Ferra Xu
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

[R] Problem with "nlm" function to minimize the negative log likelihood

2014-06-23 Thread Ferra Xu
Hi all  I have a problem in using "nlm" function to minimize the negative log likelihood of a function in R. The problem is that it gives me the same estimated values for all the parameters, except one of them, in each iteration!! Does anyone have any ideas what may cause this mistake?  Thank y

[R] Is there anyone who is familiar with PtProcess package?

2014-06-20 Thread Ferra Xu
Hi all, I am trying to use template function for spatial ETAS (not the simulation code, but the loglikelihood estimation) with some changes (in 3-D space and with different omori function). I changed the etas_normal0 function and the main code accordingly but still it doesn't give me the correc

[R] Simulating spatio-temporal marked ETAS point process

2014-06-13 Thread Ferra Xu
Hello all I am searching for a package or code that is used for generating data for spatio-temporal marked ETAS processes. I saw that spatial ETAS function in "PtProcess" package doesn't work with "simulate" function... Thank you in advance, Ferra [[alternative HTML version deleted]]

[R] Spatio-Temporal marked Hawkes (self-exciting) point processes

2014-06-10 Thread Ferra Xu
Hello All I'd like to know if there is any package for simulating and parameter estimation of Spatio-Temporal marked Hawkes (self-exciting) point processes? I know that PtProcess works for modeling marked point processes indexed by "time", but I need to include space too. Appreciate your help

Re: [R] How to fix the format in write.csv

2014-05-02 Thread ChangJiang Xu
> > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > H. Gilbert Welch > > > > > On Fri, May 2, 2014 at 11:34 AM, ChangJiang Xu > wrote: > > By dafault, write.csv will change the characters such as

[R] How to fix the format in write.csv

2014-05-02 Thread ChangJiang Xu
By dafault, write.csv will change the characters such as "5/38" as a date "May-38". How can I not change the format? Thanks. ChangJiang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] How does locpoly (KernSmooth package) estimate densities?

2014-03-26 Thread Xu Wang
33502/r-locpoly-is-incorrectly-returning-nan. Best wishes, Xu __ 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 commented, minimal, self-contained, reproducible code.

[R] locpoly is returning NaN if bandwidth is small

2014-03-17 Thread Xu Wang
dwidth in this situation is a horrible idea. My goal is to understand how locpoly can behave differently on different computers and how I can solve that. Thank you and kind regards, Xu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] how is the model resample performance calculated by caret?

2014-02-27 Thread zhenjiang zech xu
Dear all, I did a 5-repeat of 10-fold cross validation using partial least square regression model provided by caret package. Can anyone tell me how are the values in plsTune$resample calculated? Is that predicted on each hold-out set using the model which is trained on the rest data with the opti

[R] glmer vs glmmadmb

2013-09-18 Thread kenny xu
Dear All I have fitted the following glmm: cmai ~ time.f * intrv.f + (1 | nhome.f/Res_Code.f) with poisson distribution, using both glmer and glmmadmb. But the estimation for the fixed and random effects were different, i.e. > summary(lmer.AGGREG.cmai.out3) Call: glmmadmb(formula = c

[R] A question on the abline function

2013-07-08 Thread Xu, Jia2
Dear whom it may concerns, I am Jia Xu, a summer intern analyst at Citi Research. I am also a graduate student studying Financial Engineering at Cornell. I am running regression analysis with Rstudio now. I have been experiencing difficulty with the abline function. No matter I call it

Re: [R] multilevel binary and ordered regression models

2013-06-09 Thread Xu Jun
latively large data set, but is there any way to speed up the estimation a bit. Thanks a lot! Jun On Fri, Jun 7, 2013 at 1:04 AM, Rune Haubo wrote: > On 6 June 2013 00:13, Xu Jun wrote: >> Dear r-helpers, >> >> I have two questions on multilevel binary and ordered regressi

[R] multilevel binary and ordered regression models

2013-06-05 Thread Xu Jun
s to run the model: glmer(y ~ x1 + x2 + x3 + w1 + w2 + w1:x1 + w2:x2 + (1 + x1 | group), data = mydata, family = binomial) Thanks! Jun Xu, PhD Associate Professor Department of Sociology Ball State University Muncie, IN47306 [[alternative HTML version deleted]] _

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Xu Jun
onsulting with a > local statistician/R expert who would help you with a major rewrite of > your code. > > But ... note my disclaimer again at the top. > > Cheers, > Bert > > On Wed, Aug 1, 2012 at 2:34 PM, Xu Jun wrote: >> Thanks Michael. No

Re: [R] optim() for ordered logit model with parallel regression assumption

2012-08-01 Thread Xu Jun
te I know there is something wrong with the way that I set up my initial values, but just couldn't figure out how. Any help would be greatly appreciated! Jun On Tue, Jul 31, 2012 at 10:07 PM, R. Michael Weylandt wrote: > On Tue, Jul 31, 2012 at 7:57 PM, Xu Jun wrote: >> Dear R li

[R] optim() for ordered logit model with parallel regression assumption

2012-07-31 Thread Xu Jun
something related to the class type (numeric vs. matrix) or something along that line among those if conditions. Thanks in advance for any suggestion. Jun Xu, PhD Assistant Professor Department of Sociology Ball State University Muncie, IN 47306

[R] CSPADE error: system invocation error

2012-04-03 Thread Sue Xu
Hi, I am trying to use the CSPADE function as part of the ArulesSequences package. When running with my own data I get a system invocation error, and also get the same when running the built in example with the zaki data: > example(cspade) And get the following error: preprocessing ...Error i

[R] read in Stata and SPSS with value labels/formats

2012-01-19 Thread Xu Jun
`, value = c("ARMED FORCES", "Soldiers", "Officers",  :  duplicated levels will not be allowed in factors anymore Any thoughts or suggestions? Thanks a lot! Jun Xu, PhD Assistant Professor Department of Sociology Ball State University _

[R] loops over regression models

2012-01-13 Thread Xu Jun
But I got an error message that says variable length differ. I tried various ways to work around this, for example, I tried: clist <- c("mom_iq", "mom_hs") for (x in 1:length(clist)) { lm(kid_score ~ clist[x], data = kidiq) } But none of these

Re: [R] Zellig Error Message

2011-12-17 Thread Xu Wang
Hi Abraham, Zelig has its own mailing list. You should sign up for it there. The developers are usually great about responding. Xu On Fri, Dec 16, 2011 at 10:47 AM, Abraham Mathew wrote: > I'm trying to calculate predicted probabilities in R with Zelig and keep > getting the foll

Re: [R] Monetary support to the R-project (Was: Re: Executable for Production Use)

2011-12-14 Thread Xu Wang
I am still interested in this. Is there no way to pay directly online? via paypal or other? Thanks, Xu -- View this message in context: http://r.789695.n4.nabble.com/Re-Monetary-support-to-the-R-project-Was-Re-Executable-for-Production-Use-tp1585186p4198369.html Sent from the R help mailing

Re: [R] Transforming a string into a command

2011-11-29 Thread Xu Wang
Petr, thanks for pointing that out. Jim, you are exactly right! Thank you for catching that. I did not realize in the other replies that they were using log and not ln. David, thank you for the lessons. I will improve my question asking skills. Thanks to all, Xu On Tue, Nov 29, 2011 at 9:31 AM

Re: [R] Transforming a string into a command

2011-11-29 Thread Xu Wang
a<-1 b<-2 eval(parse(text=s)) Error in eval(expr, envir, enclos) : could not find function "ln" Perhaps it's because I don't understand eval well (any good references for reading up on eval, parse, substitute, etc.?). But I expected it to produce the same as the following l

Re: [R] Transforming a string into a command

2011-11-28 Thread Xu Wang
Why don't the following two commands work? eval(parse(text=s)) eval(as.expression(s)) -- View this message in context: http://r.789695.n4.nabble.com/Transforming-a-string-into-a-command-tp4112183p4118243.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] changelog for MASS?

2011-11-16 Thread Xu Wang
Michael, Thanks a lot for the suggestions! Those are good ideas, Xu -- View this message in context: http://r.789695.n4.nabble.com/changelog-for-MASS-tp4034473p4079157.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

Re: [R] linear against nonlinear alternatives - quantile regression

2011-11-16 Thread Xu Wang
I'm just curious if Professor Koenker responded to this (e.g. in an individual email or otherwise), as I would be interested in the answer. -- View this message in context: http://r.789695.n4.nabble.com/linear-against-nonlinear-alternatives-quantile-regression-tp3993327p4077713.html Sent from the

Re: [R] changelog for MASS?

2011-11-14 Thread Xu Wang
Thanks Michael, But I can't see the dates on the NEWS so I have no idea what changed from last version or from whichever version we actually have installed. Do you see what I mean? Thanks, Xu -- View this message in context: http://r.789695.n4.nabble.com/changelog-for-MASS-tp4034473p40

[R] changelog for MASS?

2011-11-12 Thread Xu Wang
Does anyone know where I can find a changelog for MASS? It's difficult to know whether I should ask my company to update the package or not. We are usually required to show the changelog, but I can't find one. Thank you, Xu -- View this message in context: http://r.789695.n4.

[R] Need help for the CO_PLOT method

2011-11-07 Thread Hui Xu
work in R before? It looks like biplot, but they are different. I am not sure whether vegan is the right package to do this, anyone has suggestions for this? Thank you so much! Best Hui -- Hui Xu Graduate Student School of Natural Resources and Environment University of Michigan, Ann Arbor Cell

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
Dear Prof. Fox, I just picked up R not long ago, and apologize that I am not that familiar with some basics. I am trying to replicate what I can do with Stata in R. Thanks for all your help! On Thu, Oct 20, 2011 at 2:47 PM, John Fox wrote: > Dear Xu Jun, > > On Thu, 20 Oct 2011 14:41

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
hat makes graphing so much easier. Jun On Thu, Oct 20, 2011 at 11:55 AM, John Fox wrote: > Dear Xu Jun, > > I'm not sure whether this is the source of the error, but it may help to > spell the xlevels argument correctly (it is not

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
will keep working on the codes and see if I can figure out. Again, your effects package, I have to say, is awesome! Jun On Thu, Oct 20, 2011 at 1:26 PM, Xu Jun wrote: > Dear Professor Fox, > > Thanks a lot! That is an embarrassing error. After I cleaned up and > simplified my codes, and

Re: [R] effect function in the effects package

2011-10-20 Thread Xu Jun
or in evaluating the argument 'x' in selecting a method for function 'plot': Error in model.frame.default(formula = factor(warm) ~ yr89 + male + white + : variable lengths differ (found for 'yr89') On Thu, Oct 20, 2011 at 11:55 AM, John Fox wrote: > Dear Xu Ju

[R] effect function in the effects package

2011-10-20 Thread Xu Jun
Dear r-help listers, I am using effects to produce an effect plot after the proportional odds logistic regression model. There is no problem for me to estimate the model, but when it comes to the graphing, I was stuck. see the codes below: #

[R] hypothetical prediction after polr

2011-10-18 Thread Xu Jun
1 Can anyone help me out with this error here? Thanks a lot! Jun Xu, Phd Assistant Professor Department of Sociology Ball State University P.S.: below is the detailed output from R Call: polr(formula = factor(warm) ~ yr89 + ma

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
or match. The best > > solution would be to avoid the internal use of deparse > > when using match() or unique() on lists and to hash the > > list element directly, but that is a fair bit of work. > > ** ** > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap ti

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
> *** > > to match. E.g., > > ac <- sapply(a, function(ai) paste(collapse="\n", deparse(ai))) > > and use match on that. You can use the indices it returns on > > the original list. > > ** ** > > Bill Dunlap > Spotfire, TIBCO Software &

Re: [R] how to create data.frames from vectors with duplicates

2011-09-07 Thread zhenjiang xu
0.160.030.18 > > system.time(with(dt, rowsum(x, y))) > user system elapsed > 0.360.040.40 > > system.time(with(dt, tapply(x, y, sum))) > user system elapsed > 8.770.339.11 > > HTH, > Dennis > > > On Wed, Sep 7, 2011 at

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
; [31] "YMR050C" "YOLWTy1-1" "YOL103W-B" "YORWTy1-2" "YOR142W-B" "YPLWTy1-1" [37] "YPL257W-B" "YPRCTy1-2" "YPR137C-B" "YPRWTy1-3" "YPR158W-B" [[4]] [1] "YARCTy1-1" "YA

Re: [R] read.table truncated data?

2011-09-07 Thread zhenjiang xu
(data) > > to see that size is as expected. > > Regards > Petr > > > > > On Thu, Aug 25, 2011 at 11:57 AM, jim holtman > wrote: > > > > > But did you try the following: > > > > > > x <- read.table(, comment.char =

Re: [R] how to create data.frames from vectors with duplicates

2011-09-07 Thread zhenjiang xu
1 at 9:50 AM, Jorge I Velez > wrote: > > Hi Zhenjiang, > > > > Try > > > > table(unlist(mapply(function(x, y) rep(x, y), y, x))) > > Yikes! How about simply tapply(x,y,sum) ?? > ?tapply > > -- Bert > > > > HTH, > > Jorge > &g

Re: [R] counting the duplicates in an object of list

2011-09-07 Thread zhenjiang xu
t the best depends on what you want to do with the > data. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of zhenjiang xu > > S

Re: [R] heatmap

2011-09-06 Thread Jinrui Xu
"density" of grid. I am not familiar with R code, so I am writting to ask how to. Thanks! jinrui, Quoting Sarah Goslee : You mean like the examples in help("heatmap") ? On Tue, Sep 6, 2011 at 1:20 PM, Jinrui Xu wrote: Hi everyone, I have three numerica vectors: x, y

[R] heatmap

2011-09-06 Thread Jinrui Xu
Hi everyone, I have three numerica vectors: x, y, z. I want to plot a heatmap or surface plot of z against x and y. Is there any package for this? If possible, please drop me several lines of example code. Thanks! jinrui, __ R-help@r-project.org

[R] how to create data.frames from vectors with duplicates

2011-08-31 Thread zhenjiang xu
Hi R users, suppose I have two vectors, > x=c(1,2,3,4,5) > y=c('a','b','c','a','c') How can I get a data.frame like this? > xy count a 5 b 2 c 8 I know a few ways to fulfill the task. However, I have a huge number of this kind calculations, so I'd like an efficient solution. T

Re: [R] sum of two lists

2011-08-31 Thread zhenjiang xu
Thanks, Henrique. It works. On Mon, Aug 29, 2011 at 6:45 PM, Henrique Dallazuanna wrote: > Try this: > as.list(colSums(merge(m, n, all = TRUE), na.rm = TRUE)) > > On Mon, Aug 29, 2011 at 7:39 PM, zhenjiang xu > wrote: >> >> Hi R users, >> >> Suppose I

[R] counting the duplicates in an object of list

2011-08-31 Thread zhenjiang xu
Hi all, I have a list x:  > x=list(a=c('1','2'),b=c('2','3'),c=c('1','2'),d=c('2','3')) I can get the unique elements with unique(), but how can I get the number of duplicates for each unique elements? > unique(x) [[1]] [1] "1" "2" [[2]] [1] "2" "3" Thanks -- Best, Zhenjiang ___

[R] sum of two lists

2011-08-29 Thread zhenjiang xu
Hi R users, Suppose I have two lists and the names of list 'm' are a subset of those of 'n', how can I sum the two lists with corresponding elements added together to get list 'o'? > n = list("a"=1,"b"=3,"c"=5) > m = list('b'=4) > o $a [1] 1 $b [1] 7 $c [1] 5 Thanks -- Best, Zhenjiang

Re: [R] read.table truncated data?

2011-08-25 Thread zhenjiang xu
somewhere in your data. > use a text editor and search for single and double quotes. > > On Thu, Aug 25, 2011 at 11:49 AM, zhenjiang xu > wrote: > > Thanks for your replies. I looked at those lines and didn't spot anything > > unusual. > > > >> tail(a) >

Re: [R] read.table truncated data?

2011-08-25 Thread zhenjiang xu
.0121587 yes ETS1-2 - ETS1-2 chr12:466869-467569 WT air2rrp6OK 3258.97 1114.76 -1.072772.91211 0.00359 0.0121597 yes On Wed, Aug 24, 2011 at 2:34 PM, Sarah Goslee wrote: > Hi, > > On Wed, Aug 24, 2011 at 2:18 PM, zhenjiang xu > w

[R] read.table truncated data?

2011-08-24 Thread zhenjiang xu
Hi R users, I was using read.table to read a file. The data.fame looked alright, but I found not all rows are read by the read.table. What's wrong with it? It didn't give me any warning or error messages. Why the data are truncated? Thanks. $ wc -l all/isoform_exp.diff 42847 all/isoform_exp.diff

Re: [R] a question on list manipulation

2011-08-06 Thread zhenjiang xu
gt; > > Of course this version will have some problems if the names of your list > elements end with digits that you don't want stripped off (but you can work > around that by preprocessing the list names). > > -- > Gregory (Greg) L. Snow Ph.D. > Statistical Data Cent

Re: [R] a question on list manipulation

2011-08-06 Thread zhenjiang xu
hy wrote: > Hi: > > Your clarification suggests Duncan was on the right track, so how about this: > > x <- list(A=c("d", "e", "f"), B=c("d", "e"), C=c("d")) > x2 <- unique(unlist(x)) > w <- lapply(x, functi

Re: [R] a question on list manipulation

2011-08-05 Thread zhenjiang xu
verse the matching, from all the elements to the names of the list. On Fri, Aug 5, 2011 at 12:53 PM, Duncan Murdoch wrote: > On 05/08/2011 12:05 PM, zhenjiang xu wrote: >> >> Hi R users, >> >> I have a list: >> >  x >> $A >> [1] "a"  "b&

Re: [R] how to control to save plots to which dev

2011-08-05 Thread zhenjiang xu
help page more carefully. Thanks. On Fri, Aug 5, 2011 at 12:02 PM, Duncan Murdoch wrote: > On 05/08/2011 11:49 AM, zhenjiang xu wrote: >> >> Thanks, Prof Ripley. I was using dev.next(), dev.prev(),, but I am >> wondering, instead of switching the current dev, is there a way to >

[R] a question on list manipulation

2011-08-05 Thread zhenjiang xu
Hi R users, I have a list: > x $A [1] "a" "b" "c" $B [1] "b" "c" $C [1] "c" I want to convert it to a lowercase-to-uppercase list like this: > y $a [1] "A" $b [1] "A" "B" $c [1] "A" "B" "C" In a word, I want to reverse the list names and the elements under each list name. Is there any quic

Re: [R] how to control to save plots to which dev

2011-08-05 Thread zhenjiang xu
confused which dev is the current one. On Tue, Aug 2, 2011 at 1:28 AM, Prof Brian Ripley wrote: > On Tue, 2 Aug 2011, David Winsemius wrote: > >> >> On Aug 1, 2011, at 11:14 PM, zhenjiang xu wrote: >> >>> Hi, >>> >>> I have a for loop to make 2

[R] how to control to save plots to which dev

2011-08-01 Thread zhenjiang xu
Hi, I have a for loop to make 2 types of plots and I'd like to save one type of plots to a pdf file and the other to another pdf file. How can I control which plot will be saved to which pdf? Thanks -- Best, Zhenjiang __ R-help@r-project.org mailing l

Re: [R] Fwd: varimp_in_party_package

2011-06-16 Thread Jinrui Xu
$V1 <- as.factor(as.numeric(rawinput$V1)) data.controls <- cforest_unbiased(ntree=500, mtry=3) data.cforest <- cforest(V1~.,data=rawinput,controls=data.controls) data.cforest.varimp <- varimp(data.cforest, conditional = TRUE) Thanks! jinrui, Quoting Patrick Connolly : On Thu, 16-Jun-

[R] varimp_in_party_package

2011-06-15 Thread Jinrui Xu
Hello everyone, I use the following command lines to get important variable from training dataset. data.controls <- cforest_unbiased(ntree=500, mtry=3) data.cforest <- cforest(V1~.,data=rawinput,controls=data.controls) data.cforest.varimp <- varimp(data.cforest, conditional = TRUE) I got e

[R] effects package for adjusted predictions

2011-05-13 Thread Xu Jun
gitmod, xlevels=list(phd=1:5), given.values=c(female=0))) But I couldn't figure out how to get just one predicted probability with a given set of values for independent variables (for example, female=1, phd=3 and enrol = 7), and it appears that using the effect command, I have to get multiple predict

[R] get adjusted means using the effects package

2011-05-12 Thread Xu Jun
gitmod, xlevels=list(phd=1:5), given.values=c(female=0))) But I couldn't figure out how to get just one predicted probability with a given set of values for independent variables (for example, female=1, phd=3 and enrol = 7), and it appears that using the effect command, I have to get multiple predict

Re: [R] average among one factor in a nested dataframe

2011-04-25 Thread Junqian Gordon Xu
-c(1:6) > a_df<-data.frame(cbind(id,f1,"y1",a)) > id<-c(1:9) > b_df<-data.frame(cbind(id,f1,"y2",b)) > > But I don't understand the "nested" databases. > I see that both have f1 variable but I do not see f2 variable in any of > them. S

[R] average among one factor in a nested dataframe

2011-04-24 Thread Junqian Gordon Xu
I have two nested data frames: a<-rnorm(6) b<-rnorm(9) f1<-c("x1","x2","x3")) f2<-c("y1","y2") id<-c(1:6) a_df<-data.frame(cbind(id,f1,"y1",a)) id<-c(1:9) b_df<-data.frame(cbind(id,f1,"y2",b)) I want to preserve id and f1, but want to collapse f2 and take the corresponding mean values of a and b.

Re: [R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread zhenjiang xu
Thanks, Gabor. It's a nice workaround. I'll look more at zoo library. On Fri, Apr 15, 2011 at 7:10 PM, Gabor Grothendieck wrote: > On Fri, Apr 15, 2011 at 6:10 PM, zhenjiang xu > wrote: > > Thanks, Dennis! I'll go with it. It's surprising there is no ready wa

Re: [R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread zhenjiang xu
fm > x y z > 1 a 1 6 > 2 b 2 NA > 3 c 3 1 > sumdf <- data.frame(x = dfm$x, y = rowSums(dfm[, -1], na.rm = TRUE)) > x y > 1 a 7 > 2 b 2 > 3 c 4 > > HTH, > Dennis > > On Fri, Apr 15, 2011 at 1:31 PM, zhenjiang xu > wrote: > > Hi all, > > &g

[R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread zhenjiang xu
Hi all, Suppose I have 2 data.frame , a and b, how can I add them together to get c? Thanks > a A a 1 b 2 c 3 > b A a 6 c 1 > c A a 7 b 2 c 4 -- Best, Zhenjiang [[alternative HTML version deleted]] __ R-help@r-project.org mailing lis

[R] how to reshape the data.frame from long to wide in a specific order

2011-03-14 Thread zhenjiang xu
Hi, For example, the data.frame like: origdata.long <- read.table(header=T, con <- textConnection(' subject sex condition measurement 1 M control 7.9 1 M first12.3 1 Msecond10.7 2 F control 6.3 2 F first

[R] fgev_error_matrix_singular

2011-01-16 Thread Jinrui Xu
Hello everyone, I am using fgev from evd package to fitting my data with general extreme value distribution. The command I used is simple: y <- fgev(x). The error is "observed information matrix is singular;" How can I solve these problem. I tried all methods in optim and it did not work.

[R] ggplot2 problem in interacting mode

2010-11-10 Thread zhenjiang xu
Hi all, When running R interactively, I have the problem as following: > library(ggplot2) Loading required package: reshape Loading required package: plyr Attaching package: 'reshape' The following object(s) are masked from 'package:plyr': round_any Loading required package: grid Loading

[R] error bars in lattice barchart

2010-11-10 Thread zhenjiang xu
Hi all, I've read the emails of Dan, Deepayan and Sundar about adding error bars to the lattice plots ( https://stat.ethz.ch/pipermail/r-help/2006-October/114883.html), but I still have the problem when I want to adding error bars to barchart. I tried both the solution of Deepayan and Sundar but w

Re: [R] How to do bootstrap for the complex sample design?

2010-11-07 Thread Fei xu
Dear Professor Lumley; Thank you so much for your invaluable advice! I will digest your advice and try different methods. Great thanks again! Faye > Date: Fri, 5 Nov 2010 08:24:00 +1300 > Subject: Re: [R] How to do bootstrap for the complex sample design? > From: tlum...@uw.edu > To: ti

[R] How to do bootstrap for the complex sample design?

2010-11-04 Thread Fei xu
Hello; Our survey is structured as : To be investigated area is divided into 6 regions, within each region, one urban community and one rural community are randomly selected, then samples are randomly drawn from each selected uran and rural community. The problems is that in urban/rural s

Re: [R] odfWeave Issue.

2010-08-11 Thread Xu Wang
an error in the document format? Good job figuring it out. Did you submit a bug report? -- View this message in context: http://r.789695.n4.nabble.com/odfWeave-Issue-tp2321369p2321833.html Sent from the R help mailing list archive at Nabble.com. __ R-

[R] matrix problem

2010-08-10 Thread zhenjiang xu
Hi, I have a file like this: 1 2 0.1 2 3 0.2 3 1 0.3 And I want to read it to create a matrix like this: [,1] [,2][,3] [1,]0 0.1 0 [2,]0 00.2 [3,]0.300 How can I do it efficiently? Thanks. -- Best, Zhenjiang [[alternative HTM

Re: [R] How to start R

2010-08-07 Thread Xu Wang
Hi satimis, I also use Ubuntu 10.04 and R. I just wanted to say that it is very hard to get started in R. I'm guessing you know this, but I just wanted to add some encouragement and mention that if you find yourself getting frustrated at times or taking a very long time to do things that are extre

Re: [R] ggplot2 histograms... a subtle error found

2010-08-02 Thread Xu Wang
There is a google group dedicated to ggplot2. It might be worth making a post there: http://groups.google.com/group/ggplot2?pli=1 -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-histograms-a-subtle-error-found-tp2305814p2311082.html Sent from the R help mailing list archi

Re: [R] simple table/matrix problem

2010-07-31 Thread Xu Wang
Hadley Wickham's reshape package makes tasks like these pretty easy. http://cran.r-project.org/web/packages/reshape/index.html -- View this message in context: http://r.789695.n4.nabble.com/simple-table-matrix-problem-tp2307969p2308713.html Sent from the R help mailing list archive at Nabble.co

Re: [R] lm.influence on glm objects

2010-07-30 Thread Xu Wang
Was this issue resolved? -- View this message in context: http://r.789695.n4.nabble.com/lm-influence-on-glm-objects-tp1574781p2307622.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.

[R] how to display the value of each data points on the levelplot

2010-05-05 Thread zhenjiang xu
Hi R users, How can I display the corresponding value inside each little square of level plot plotted by the following code? > data(Cars93, package = "MASS") > cor.Cars93 <- cor(Cars93[, !sapply(Cars93, is.factor)], use = "pair") > levelplot(cor.Cars93, aspect = 1, scales = list(x = list(rot = 90)

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Mandy Xu
a week now, and still no solution... On Mon, Apr 26, 2010 at 10:31 PM, Duncan Murdoch wrote: > Mandy Xu wrote: > >> Hi R users, >> >> Does anyone know how to change the size of 3d charts? I'm using surface3d >> in >> rgl package, opening a new window each time

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Mandy Xu
a week now, and still no solution... On Mon, Apr 26, 2010 at 10:31 PM, Duncan Murdoch wrote: > Mandy Xu wrote: > >> Hi R users, >> >> Does anyone know how to change the size of 3d charts? I'm using surface3d >> in >> rgl package, opening a new window each time

[R] How to use apply or tapply to calculat the sum of squared residuals

2010-04-30 Thread Xu, Roy
Dear all, I have a time series data X and want to calculate the sum of squared residuals (SSR) at each time point. SSR at time point m consists of two parts. The first part is the sum of squared residuals for all time points before m, and the second part is the sum of squared residuals for all

  1   2   >