Re: [R] [Question] about plot.xts

2015-02-14 Thread Jeff Newmiller
It means that xtsExtra has a different version if plot.xts, and that will be the one that gets run when you call that function. If you want to use the one that is defined in xts, you can specify it... xts::plot.xts(...) In the future, don't post in HTML, since this is a plain text only list. We

[R] [Question] about plot.xts

2015-02-14 Thread KWCG HE
Hi All, I am trying to use xts and xtsExtra packages to plot multiple time series on one plot. I got two questions about this package. What's the meaning of "*The following object is masked from ‘package:xts’:*" when load xts and xtsExtra?* which plot.xts will be available if I local xts first a

Re: [R] Nonlinear integer programming (again)

2015-02-14 Thread Rich Shepard
On Sat, 14 Feb 2015, Zwick, Rebecca J wrote: My question is whether there is an R package that can handle this problem. Rebecca, I'm not sure, but have you looked at the Simplex method in the boot() package? Rich

[R] Nonlinear integer programming (again)

2015-02-14 Thread Zwick, Rebecca J
Another user suggested I elaborate on my previous post, giving specifics of the problem I am trying to solve. Here they are: It is a selection problem involving sample weights. Say we have applicants with test scores x. The vector y indicates whether the applicant is a member of Group Y, w

Re: [R] Genrating Ordinal Responses in R

2015-02-14 Thread arnabkm2007
Thank you very much JS Huang. It helps. Thanks & Regards, Arnab Arnab Kumar Maity Graduate Teaching Assistant Division of Statistics Northern Illinois University DeKalb, IL 60115 Email: ma...@math.niu.edu Ph: 779-777-3428 On Fri, Feb 13, 2015 at 5:03 PM, JS Huang [via R] < ml-node+s789695n

[R] RMySQL works inside function, but prints Error output when executed outside a function

2015-02-14 Thread Brent via R-help
On my computer, if I execute this R code inside the console of Rgui.exe     execInsideFunction = function() {         dbc = dbcLocal         conn <- dbConnect(MySQL(), host = dbc$host, dbname = "xxx", user=dbc$user, password=dbc$password)         dbSendQuery(conn, "delete from yyy")         dbDis

Re: [R] Unable to use `eval(parse(text))' in nlme::lme

2015-02-14 Thread Ravi Varadhan
Yes, this is a very important point. Thank you, Bill. Best, Ravi From: William Dunlap Sent: Friday, February 13, 2015 4:56 PM To: Ravi Varadhan Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] Unable to use `eval(parse(text))' in nlme::lme > ff <- reformulate(ter

[R] my code in Metro_Hastings

2015-02-14 Thread hms Dreams
Hi again :) my code is in the attachment file the problem I think in the : mcmc_r=Metro_Hastings(li_func=baysianlog, pars=c(1,1,1),par_names=c('alpha','gamma','delta'),data=x ) because I did not write the prop_sigma because I don't know how can I calcalute the covariance matrix. somebody

[R] BondLab Package

2015-02-14 Thread Glenn Schultz
Hi All, I am getting closer to finalizing the package.  Below is all my information;   Description, namespace, and check from R Studio.  I know its basically lubridate as well as bond basis function.  I re-read the section on environments in Advanced R as I was thinking this is environment rela

[R] Automate multiple meta-analyses

2015-02-14 Thread Avraham Kluger
I have scores of data sets ready for meta-analyses. I would like to run them as separate meta-analyses because otherwise I will be mixing apples with oranges. In the code below, I successfully run a single meta-analysis with a moderator. metacor(rho,N,Study,data=Leadership,comb.fixed=F,predic

Re: [R] Use of R for Hypothesis Testing

2015-02-14 Thread Kevin E. Thorpe
You will only really learn R by reading and trying things yourself. As John says, there are many good books out there. Have you read the introductory material that comes with R in the help system? I would recommend you start the help system and scroll through the list of functions contained in

Re: [R] 2d rotation: vegan?

2015-02-14 Thread William Revelle
Randall, You might try the factor.rotate function in the psych package. That will allow you to “hand rotate” any solution where (in your example) nmdp is a matrix. You also could look at the the various rotations available in the GPArotation package. Bill > On Feb 13, 2015, at 9:08 AM, Ran

Re: [R] Use of R for Hypothesis Testing

2015-02-14 Thread John Kane
There are anumber of good papers and books in pdf format at the R site. Select a CRAN location and you should see an entry for them on the left side of the page. Pick a couple and see if they help. And for a fun read on introductory statistics in general which should cover everything you wante

Re: [R] ggplot2 shifting bars to only overlap in groups

2015-02-14 Thread John Kane
John Kane Kingston ON Canada -Original Message- From: hyil...@gmail.com Sent: Sat, 14 Feb 2015 16:32:03 +0800 To: jrkrid...@inbox.com Subject: Re: [R] ggplot2 shifting bars to only overlap in groups I think maybe it is possible to first produce a blank axis, and then splitting the data f

Re: [R] help please >>metro_hastings function

2015-02-14 Thread John Kane
It looks like you posted in HTML and the result are garbbled. ONly post in plain text. Also it might help to read one or both of these https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston

Re: [R] How can you validate association rules?

2015-02-14 Thread Jeff Newmiller
It will help greatly if you can learn to communicate according to the norms of the list. Reading the Posting Guide mentioned at the bottom of this email will help. 1) This mailing list is plain text. If you send HTML email it will get converted and we won't see what you see, which leads to mis

[R] help please >>metro_hastings function

2015-02-14 Thread hms Dreams
Hi :)anybody can help me please I'm trying to use Metro_Hastings ( MHadaptive package)the proplem is: How can I know the covariance matrix( prop_sigma ) to enter it in Metro_Hastings: mcmc_r=Metro_Hastings(li_func=baysianlog, pars=c(1,1,1), prop_sigma =NULL,par_names=c('alpha','gamma','del

Re: [R] ggplot2 shifting bars to only overlap in groups

2015-02-14 Thread Hörmetjan Yiltiz
I think maybe it is possible to first produce a blank axis, and then splitting the data frame by the value of *direction. *Then add the goem_bar and goem_errorbar for the blank axis for the first split, then add them for the second half split. This is actually a slit-apply-combine strategy. It woul

Re: [R] Use of R for Hypothesis Testing

2015-02-14 Thread Jim Lemon
Hi Sike, Start an R session, issue the command "help.start()" and check the help pages for "t.test", "chisq.test" and "aov" in the "stats" package. Jim On Sat, Feb 14, 2015 at 4:17 AM, Sike Li wrote: > Dear Staff > Hello, > > I am recently trying to learn some functions of R. How would I use R

Re: [R] Error when I attempt to create a list or a data frame

2015-02-14 Thread Uwe Ligges
On 13.02.2015 18:15, Michael Pomeroy wrote: When I try to create a list with three classes of objects: a numeric, boolean, and vector of character data: lst <- list(c(1,2),TRUE,c(“a”,“b”,“c”)) I receive this error: Error: unexpected input in "lst <- list(c(1,2),TRUE,c(“" Do not use directe

Re: [R] Use of R for Hypothesis Testing

2015-02-14 Thread Uwe Ligges
On 13.02.2015 18:17, Sike Li wrote: Dear Staff There is no staff, only volunteers who answer messages in their spare time. Hello, I am recently trying to learn some functions of R. How would I use R to do T-test, confidence interval calculation, chi-square test and ANOVA? Please re-rea

Re: [R] lme: Can not find groupData object in a function could this be a scoping problem?

2015-02-14 Thread JS Huang
Hi, Unless you defined SS somewhere before you execute "data <- data.frame(group=c(rep("Cont",SS),rep("Exp",SS)), pre=pre,post=post)", SS is not assigned. Maybe it is TS you intended? doit<- function(TS,rho,premean,presd,RxEffect) { . . . # Prepare data frames for regression analyses.

Re: [R] Caleberating weights

2015-02-14 Thread JS Huang
Hi, It's not clear what wizi is in the constraint Sum(wizi) = Z. If you can provide some data, it may make the problem easier to understand. -- View this message in context: http://r.789695.n4.nabble.com/Caleberating-weights-tp4703226p4703245.html Sent from the R help mailing list archive a

Re: [R] Coverage probability for a Poisson parameter

2015-02-14 Thread JS Huang
Hi, Some suggestion about the arguments of the function defined below. Since theta is calculated with the value of lambda1 and lambda2, there is no need to include theta in the argument. Or, your function can be defined as function(lambda1, lambda2, significance.level) cover <- function(theta

Re: [R] Genrating Ordinal Responses in R

2015-02-14 Thread JS Huang
Hi, Here assume there are four elements in the ordinal set y and take a random sample of size 10 according to the cumulative distribution given, or probability distribution p below. > y <- c(levels = c("First", "Second", "Third", "Fourth")) > y levels1 levels2 levels3 levels4 "First" "Se

Re: [R] sd, mean with a frequency distribution matrix

2015-02-14 Thread dorian_pg
Thank you, I'll try as soon as possible! Il 13/Feb/2015 22:28 "JS Huang [via R]" < ml-node+s789695n470323...@n4.nabble.com> ha scritto: > Or if you want to perform the calculation without using sd: > > sqrt((sum(p[,1]^2*p[,2])-(sum(p[,1]*p[,2]))^2/sum(p[,2]))/(sum(p[,2])-1)) > > >

Re: [R] Coverage probability for a Poisson parameter

2015-02-14 Thread JS Huang
Hi, Given the function cover, it's very likely that you will get 0 for both s1 and s1 with small value of lambda1 and lambda2. In that case the sum s will be 0. With s being 0, you will have issue with the expression in pi <- s2/s and root <- ((s2/s)*(1-s2/s)+k/(4*s))^(1/2). You need to take

[R] Caleberating weights

2015-02-14 Thread Zahoor
Hi, Suppose I have weights di, I want to calibrate thesis weights I used the objective function Obj = Sum( wi/di-1)^2/2 ; where will be the resulting calibrated weights My calibration constraint is Sum(wizi) = Z , Z is pop total(1) I need r-code to minimize 'Obj' subject to the con

Re: [R] Sorting Surv objects

2015-02-14 Thread Professor Bickis
Thanks for the quick response. My work-around was suggested as a quick fix for right-censored data, not as a general sort method for censored data. My concern was that sort does not work on right-censored data as described in the xtfrm documentation. Mik Bickis > On Feb 13, 2015, at 05:53 A

Re: [R] sd, mean with a frequency distribution matrix

2015-02-14 Thread JS Huang
Or if you want to perform the calculation without using sd: sqrt((sum(p[,1]^2*p[,2])-(sum(p[,1]*p[,2]))^2/sum(p[,2]))/(sum(p[,2])-1)) -- View this message in context: http://r.789695.n4.nabble.com/sd-mean-with-a-frequency-distribution-matrix-tp4703218p4703231.html Sent from the R help mailing

[R] Use of R for Hypothesis Testing

2015-02-14 Thread Sike Li
Dear Staff Hello, I am recently trying to learn some functions of R. How would I use R to do T-test, confidence interval calculation, chi-square test and ANOVA? -- Thank you Sike Li (Lydia) [[alternative HTML version deleted]] __ R-help@r-pro

Re: [R] Coverage probability for a Poisson parameter

2015-02-14 Thread JS Huang
Hi, In your function cover, lambda1 and lambda2 are used but not in the argument of the function. I suppose that you need to have lambda1 and lambda2 in the argument of the function cover, like function(lambda1, lambda2, n, significance.level). Give it a try. cover <- function(lambda, n,

[R] Error when I attempt to create a list or a data frame

2015-02-14 Thread Michael Pomeroy
When I try to create a list with three classes of objects: a numeric, boolean, and vector of character data: lst <- list(c(1,2),TRUE,c(“a”,“b”,“c”)) I receive this error: Error: unexpected input in "lst <- list(c(1,2),TRUE,c(“" I receive a similar error when I create a data frame with mixed

[R] How can you validate association rules?

2015-02-14 Thread ayane
Hey everyone, I just started learning R and statistics. I made association rules with the apriori algorithm in the arules package. I sorted them and pruned them. But now I want to validate/test them. In supervised learning they use cross validation. In this paper by Patrick O Perry http://arxi