Re: [R] Using PCA to filter a series

2014-10-04 Thread Jonathan Thayn
This is exactly what I was looking for. Thank you. Jonathan Thayn On Oct 3, 2014, at 10:32 AM, David L Carlson wrote: > You can reconstruct the data from the first component. Here's an example > using singular value decomposition on the original data matrix: > >> d <- cbind(d1, d2, d3, d4)

Re: [R] R Markdown (Rstudio) Limit Results in knit Pdf

2014-10-04 Thread Michael Friendly
This is a knitr-specific question, and you are probably better off posting to the stackoverflow knitr questions site, http://stackoverflow.com/questions/tagged/knitr Nonetheless, here is what I use to add an output.lines options to chunk output. This works for me using LaTeX output; you can t

[R] Inference() Function Insisting That I Use ANOVA Versus Two-Sided Hypothesis Test; R/RStudio

2014-10-04 Thread Jason Eyerly
Hello All. I'm trying to use a custom function called Inference() as seen in the code below. There's no documentation for the function, but it is from my DASI class in Coursera. According to the feedback I have received, I am using the function properly. I'm trying to do a two-sided hypothesis

[R] get names of glm and related families from an object

2014-10-04 Thread Michael Friendly
In a function I'm writing, I want to handle a variety of families of glm() and related models including MASS::glm.nb() and hopefully countreg::hurdle(), zeroinfl(). A central part of the function is a switch() call family <- object$family$family switch(family, "binomial" =

Re: [R] Rolling window linear regression

2014-10-04 Thread Bert Gunter
Use ?loess instead. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Sat, Oct 4, 2014 at 12:09 AM, Grace Shi <1104271...@qq.com> wrote: > > I have to do rol

Re: [R] Question about range of letters

2014-10-04 Thread Robert Baer
On 10/4/2014 8:21 AM, Nia Gupta wrote: Hello, I have a column with a bunch of letters. I would like to keep some of these letters (A,C,D,L) and turn the rest into 'X'. I have tried using ifelse with '|' in between the argument but it didn't work nor did 4 separate ifelse statements. Example

Re: [R] Question about range of letters

2014-10-04 Thread Ben Bolker
Nia Gupta yahoo.com> writes: > > Hello, > I have a column with a bunch of letters. I would like to keep some > of these letters (A,C,D,L) and turn the rest into 'X'. > I have tried using ifelse with '|' in between the argument but it > didn't work nor did 4 separate ifelse statements. > E

[R] R Markdown (Rstudio) Limit Results in knit Pdf

2014-10-04 Thread Teis M. Kristensen
Hi all, I am writing here because I would like to limit the number of lines that are produced from a function when I knit my markdown document in R. The code is written down as following and gives 50+ lines of data when run. My goal is to only have 9 lines of code produced by the sedist functio

[R] Question about range of letters

2014-10-04 Thread Nia Gupta
Hello, I have a column with a bunch of letters. I would like to keep some of these letters (A,C,D,L) and turn the rest into 'X'. I have tried using ifelse with '|' in between the argument but it didn't work nor did 4 separate ifelse statements. Example, I currently have: Letters    A    B  

Re: [R] Rolling window linear regression

2014-10-04 Thread Grace Shi
I have to do roll regression based on the Daily data. I use the past three weeks of daily returns as the estimation window and the regression is estimated rolling forward one week at a time generating time series estimates of beta. I know I should use the rollapply in zoo package. but I am

Re: [R] merge by time, certain value if 5 min before and after an "event"

2014-10-04 Thread Dagmar
Thank you Jean, Petr, Terry, William and everyone else who thought about my problem. It is sooo good that this mailing list exists! I solved my problem using Petr's suggestion, that didn't seem so complicated and worked fine for me. Thanks again and have a great weekend, Dagmar Am 02.10.2014