Re: [R] non negativity constraints if else function

2014-12-21 Thread Jeff Newmiller
Please keep the conversation on the list, Esra... I don't do personal tutoring online, and others may answer your questions sooner and better than I can. Some comments below: On Sat, 20 Dec 2014, Esra Ulasan wrote: Hello, Thank you very much for your concern. I have these codes for

Re: [R] How to create a time series object with time only (no date)

2014-12-21 Thread ce
Thanks Joshua, Would you kindly explain if I have an xts array with different dates how I change all dates to 1970-01-01 without touching the time ? I tried with indexFormat without success. indexFormat(s) - 1970-01-01 %H:%M:%S . when I plot a graph it still shows original dates. ce

Re: [R] How to create a time series object with time only (no date)

2014-12-21 Thread Joshua Ulrich
On Sun, Dec 21, 2014 at 7:59 AM, ce zadi...@excite.com wrote: Thanks Joshua, Would you kindly explain if I have an xts array with different dates how I change all dates to 1970-01-01 without touching the time ? I tried with indexFormat without success. indexFormat(s) - 1970-01-01 %H:%M:%S

Re: [R] R - Aggregate 3-Hourly Block Data into Weekly (Melt)

2014-12-21 Thread Shouro Dasgupta
Apologies for re-posting. Any suggestions for clipping/subsetting panel data (ID=US counties, Time=Week)? I would like start the data to start on the first Monday and end on the last Sunday for the time period 2026-2045. Thanks and apologies again. Sincerely, Shouro On Fri, Dec 19, 2014 at

Re: [R] how update to latest version of R on mac

2014-12-21 Thread Thomas Adams
Jane, My sincere apologies; I don't know what I was seeing/thinking -- your original post was correct. Namely, you should download and install: http://ftp.sunet.se/pub/lang/CRAN/bin/macosx/R-3.1.2-snowleopard.pkg (although, I am use to using the main mirror

[R] MLE

2014-12-21 Thread pari hesabi
Dear Sir/Madam I am trying to get the Maximum Likelihood Estimation of a parameter in a probability mass function. The problem is my pmf which includes a summation and one integral. it is not similar to other known pdfs or pmfs such as normal, exponential, poisson, . Does anybody know

Re: [R] how update to latest version of R on mac

2014-12-21 Thread Jane Synnergren
Thanks Tom! One more quick question, regarding choosing mavericks.pkg or snowleopard.pkg. Will mavericks work for me though I have OS X Lion 10.7.5? I thought I had to choose snowleopard but are still an unexperienced mac user and have really no idea. Just want to dubble check before I run the

[R] mediation analysis in R using the method described by Lange T., et al. in the paper A simple unified approach for estimating natural direct and direct effects

2014-12-21 Thread Ruzan Udumyan
Dear All, I need to do a mediation analysis with survival data (using Cox model). - The independent variable is categorical (with 3 levels, coded as 1, 2, 3). - Mediator variable is a 1-10 score variable (derived from a continuous variable). I must confess, I am a Stata user.

Re: [R] where are the NEWS for R 3.0.0?

2014-12-21 Thread Ben Marwick
Thanks, yes I found them in my local installation, just as you said. In case anyone else wants to get them programatically, here's what I did (on windows 7, R version 3.1.1): # navigate to local R installation dir setwd(system.file()) setwd('../../doc') # get all news files news_files -

[R] Subject: short-sale constraint with nonpositive-definite matrix in portfolio optimization

2014-12-21 Thread Ravi Varadhan
Hi, You can try a projected gradient approach, which is implemented in the spg() function in the BB package. You have to provide a projection function which will take an infeasible matrix as input and will give a feasible (i.e. positive-definite) matrix as output. This kind of matrix

Re: [R] list of lists, is this element empty

2014-12-21 Thread William Dunlap
Your 'x' has length 2, so x[[3]] cannot be calculated ('subscript out of bounds' is what I get). You can check for this with length(x)3. In general, you want to be more precise: 'does not have a value', 'is NULL', and 'is empty' are not synonymous. I'm not sure what 'does not have a value'

Re: [R] How to create a time series object with time only (no date)

2014-12-21 Thread Gabor Grothendieck
On Sun, Dec 21, 2014 at 12:09 AM, ce zadi...@excite.com wrote: Dear all, I want to create a time series object from 00:00:00 to 23:59:00 without dates ? I can't figure it out with xts ? This uses zoo, rather than xts: library(zoo) library(chron) tt - seq(times(00:00:00),

Re: [R] Bca confidence intervals for Pearson coefficient, thanks.

2014-12-21 Thread John Fox
Dear Sacha, Simply write a function that takes a data set and index vector as arguments, say statistic(data, index), and have it compute and return either eta^2 or V depending upon the application. Use the function myCor() in the previous example as a model. Best, John -Original

Re: [R] MLE

2014-12-21 Thread Arne Henningsen
Dear Pari On 21 December 2014 at 06:59, pari hesabi statistic...@hotmail.com wrote: I am trying to get the Maximum Likelihood Estimation of a parameter in a probability mass function. The problem is my pmf which includes a summation and one integral. it is not similar to other known pdfs or

Re: [R] Calculating mean, median, minimum, and maximum

2014-12-21 Thread David Winsemius
On Dec 19, 2014, at 9:35 AM, Henrik Bengtsson wrote: On Fri, Dec 19, 2014 at 8:48 AM, John Kane jrkrid...@inbox.com wrote: Hi, It looks like you are replying to some phantom. Is your correspondent actully on R-help? This most likely happens because OP posted the message via Nabble

Re: [R] how update to latest version of R on mac

2014-12-21 Thread Jane Synnergren
Thanks for your response Tom, now I have successfully upgraded and my affy package problem seems to be is solved with this latest version of R and latest version of Bioconductor. Thanks! /Jane --- Jane Synnergren, PhD

Re: [R] Bca confidence intervals for Pearson coefficient, thanks.

2014-12-21 Thread varin sacha
Dear Professor FOX, I really thank you lots for all your precisions. One last precision, now if I want tot calculate the BCa bootstrap CIs for the Cramer's V and the Eta-squared. ## Read in the data file, using headers and Tab separator test = read.table(file.choose(), header = TRUE, sep = \t)

[R] 6 regions around a point

2014-12-21 Thread eliza botto
Dear UseRs, A point was plotted by the following command plot(2,4,ylim=c(0,10),xlim=c(0,5)) how to divide the space around the plotted point into six regions each of 60 degree as shown in the Figure 2a) in the following link http://infolab.usc.edu/csci599/Fall2007/papers/b-2.pdf. Thankyou very

Re: [R] 6 regions around a point

2014-12-21 Thread Boris Steipe
# A general approach to lines on a plot is provided by segments(). # However in this special case you can use abline(). # You have to take care though that your aspect ratio for the # plot is exactly 1. Therefore you have to set the asp parameter. p - c(2,4) plot(p[1], p[2], xlim=c(0,5),

Re: [R] 6 regions around a point

2014-12-21 Thread Chel Hee Lee
You may try this: get.coords.circle - function(x0, y0, r, len, rot){ + by - seq(from=-pi, to=pi, length.out=len) + x - r*cos(by+rot) + x0 + y - r*sin(by+rot) + y0 + coords - cbind(x,y) + coords[!duplicated(coords),] + } xtms - get.coords.circle(x0=2, y0=4, r=2, len=7, rot=0) xtms1 -