Re: [R] I'm writing this letter to enquire where can I download the package of "lmtest".

2011-11-20 Thread Achim Zeileis
On Mon, 21 Nov 2011, R. Michael Weylandt wrote: Please do keep your follow up on list for archival reasons: This isn't an area of particular expertise for me, but Google suggests the lmtest package does do the Durbin-Watson test: Yes, dwtest() in "lmtest" can perform both one-sided and two-si

Re: [R] Generating Sequence of Dates

2011-11-20 Thread Rainer Schuermann
> n = 2 > > > sort( rep( seq(as.Date("2000/1/1"), by="month", length.out=3), n ) ) >

Re: [R] Generating Sequence of Dates

2011-11-20 Thread Jorge I Velez
Hi, Try rep(seq(as.Date("2000/1/1"), by="month", length.out=3), each = 2) and see ?rep for more info. HTH, Jorge.- On Mon, Nov 21, 2011 at 1:16 AM, arunkumar <> wrote: > Hi. > > I need to generate a sequence of date, I need to generate date for a > period. Each date should be generated

[R] Need help

2011-11-20 Thread dilshan benaragama
Hi,  R development team,   I am trying to use PCA in labdsv package.I need to build the ordination plot from scratch. I used the following code (which is used in RDA) and I cannot get the species (variable centroids)  to the ordination plot, only I can plot sample unit scores.Can somone help me

[R] Generating Sequence of Dates

2011-11-20 Thread arunkumar1111
Hi. I need to generate a sequence of date, I need to generate date for a period. Each date should be generated n times. E.g seq(as.Date("2000/1/1"), by="month", length.out=3) the output of this is "2000-01-01" "2000-02-01" "2000-03-01" But i need each date to be generated n times, if n =2 my

[R] coverage plot

2011-11-20 Thread sutada Mungpakdee
Hi, I'm very beginner for R but I think it is a time to start as it is very useful. I have a coverage read file (illusmp454merCbed) for whole genome ~ 450 Mbp. This is head of this file. Scaffoldsca_positioncoverage Scaffold1 1 0 Scaffold1 2 0 Scaffold1

Re: [R] I'm writing this letter to enquire where can I download the package of "lmtest".

2011-11-20 Thread R. Michael Weylandt
Please do keep your follow up on list for archival reasons: This isn't an area of particular expertise for me, but Google suggests the lmtest package does do the Durbin-Watson test: http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/lmtest/html/dwtest.html Michael 2011/11/20 Sophy <100...@mail.t

Re: [R] Lattice xyplot log scale labels help!

2011-11-20 Thread Deepayan Sarkar
On Fri, Sep 16, 2011 at 6:56 PM, Deepayan Sarkar wrote: > On Fri, Sep 16, 2011 at 2:17 AM, Cram Rigby wrote: >> I have a problem with lattice log scales that I could use some help with. >> >> I'm trying to print log y-axis scales without exponents in the labels. >>  A similar thread with Deepayan

Re: [R] install.package tseries

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 6:14 PM, Joaquim Andrade wrote: I have not been successfull in downloading tseries package in the R in my macbook air. The message sent is:Error in dyn.load(file, DLLpath = DLLpath, ...) : impossível carregar objeto compartilhado '/Library/Frameworks/ If you upgraded t

Re: [R] Regarding as. Date function

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 10:46 PM, Shant Ch wrote: Hi all, I have a data set containing dates in the format of m/d/y starting from 1950. I wanted to use standard format of date R uses. So I read the data set in R and converted it using as.Dates. But for dates from 1950-1968, I have the follow

Re: [R] Deleting multiple rows from a data matrix based on exp value

2011-11-20 Thread Dennis Murphy
Without a reproducible example this is just a guess, but try Matrix[apply(Matrix, 1, function(x) any(x > 1.11)), ] This will retain all rows of Matrix where at least one value in a row is above the threshold 1.11. If that doesn't do what you want, please provide a small reproducible example and a

Re: [R] Adding two or more columns of a data frame for each row when NAs are present.

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 3:38 PM, Ian Strang wrote: I am fairly new to R and would like help with the problem below. I am trying to sum and count several rows in the data frame yy below. All works well as in example 1. When I try to add the columns, with an NA in Q21, I get as NA as mySum. I

Re: [R] logistic regression by glm

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 7:26 PM, 屠鞠传礼 wrote: Thank you very much :) I search on net and find sometimes response value in logistic model can have more than 2 values, and the way of this kinds of regression is called "Ordinal Logistic Regression". and even we can caculate it by the same way I m

Re: [R] Cox proportional hazards confidence intervals

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 6:34 PM, Paul Johnston wrote: I am calculating cox propotional hazards models with the coxph function from the survival package. My data relates to failure of various types of endovascular interventions. I can successfully obtain the LR, Wald, and Score test p-values from

Re: [R] Continuasly Compunded Returns with quantmod-data

2011-11-20 Thread Dennis Murphy
Hi: Start by writing a small utility function to compute the CCR (not to be confused with the rock band): ccr <- function(x) 100 * (log(x[-1]) - log(x[-length(x)])) # Small test: x <- round(rnorm(10, 5, 0.5), 2) ccr(x) # Works on vectors... # Load up the stock data: library(quantmod) getSy

Re: [R] Adding two or more columns of a data frame for each row when NAs are present.

2011-11-20 Thread Dennis Murphy
Hi: Does this work for you? > yy Q20 Q21 Q22 Q23 Q24 1 0 1 2 3 4 2 1 NA 2 3 4 3 2 1 2 3 4 rowSums(yy, na.rm = TRUE) 1 2 3 10 10 12 # Use a subset of the variables in yy: selectVars <- paste('Q', c(20, 21, 24), sep = '') rowSums(yy[, selectVars], na.rm = TRUE) 1

Re: [R] Inserting blank records in a barplot

2011-11-20 Thread Richard M. Heiberger
## Kodar, tmp <- textConnection("Date Time ts_mean_RR ts_sdnn_RR ts_mean_HR ts_sdnn_HR ts_rmssd 20110905 07:21:50.0 1139.829840.305352.7393 2.2824 45.7958 20110906 07:11:37.0 1182.733349.186150.8665 2.4983 60.2329 20110907 07:21:31.0 1136.602849.468252.95

Re: [R] install.package tseries

2011-11-20 Thread Hasan Diwan
On 21 November 2011 00:14, Joaquim Andrade wrote: > Do you have any clue? Works for me... How about some further details? > install.packages('tseries') --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done also installing the dependency ‘quadprog’ trying UR

[R] Regarding as. Date function

2011-11-20 Thread Shant Ch
Hi all,   I have a data set containing dates in the format of m/d/y starting from 1950. I wanted to use standard format of date R uses. So I read the data set in R and converted it using as.Dates. But for dates from 1950-1968, I have the following problem. as.Date("1/1/50","%m/%d/%y",orig

Re: [R] Data analysis: normal approximation for binomial

2011-11-20 Thread Colstat
Hey, John I like the explicit formula they put in there. I looked around last night and found this http://www.stat.yale.edu/Courses/1997-98/101/binom.htm which is basically normal approximation to the binomial, I thought that was what the author was trying to get at? Colin On Sun, Nov 20, 2011

Re: [R] logistic regression by glm

2011-11-20 Thread 屠鞠传礼
Thank you very much :) I search on net and find sometimes response value in logistic model can have more than 2 values, and the way of this kinds of regression is called "Ordinal Logistic Regression". and even we can caculate it by the same way I mean glm in R. here are some references: 1. http:

Re: [R] Factor Analysis/Inputting Correlation Matrix

2011-11-20 Thread biorafas
ey man!! you need to change the format of your data as matrix data <- as.matrix(correlation_data) solucion <- factanal(covmat = data, factors=2) that´s all!!! enjoy Rafael Ch. -- View this message in context: http://r.789695.n4.nabble.com/Factor-Analysis-Inputting-Correlation-Matrix-tp359

Re: [R] How to read the contents .dat file

2011-11-20 Thread biorafas
ey man!! one option to read .dat file is the next: data <- read.delim("document.dat", sep=" ") i hope it is useful for you Rafael -- View this message in context: http://r.789695.n4.nabble.com/How-to-read-the-contents-dat-file-tp4089943p409.html Sent from the R help mailing list archive

[R] install.package tseries

2011-11-20 Thread Joaquim Andrade
I have not been successfull in downloading tseries package in the R in my macbook air. The message sent is:Error in dyn.load(file, DLLpath = DLLpath, ...) : impossível carregar objeto compartilhado '/Library/Frameworks/ Do you have any clue? __ R-he

[R] Deleting multiple rows from a data matrix based on exp value

2011-11-20 Thread Peter Davidsen
Dear List, I have a data matrix that consists of ~4500 rows and 25 columns (i.e. an exprSet object that I converted via the 'exprs' function into a data matrix) Now I want to remove/delete the rows where all exp. values in that particular row are below or equal to a specific cut-off value (e.g 1.

Re: [R] Using GIS data in R

2011-11-20 Thread Zuofeng Shang
Many thanks Rolf! Your help is highly appreciated since it helps me understand the clue of solving my problem. Have a wonderful Sunday! Jeff 于 2011/11/20 15:52, Rolf Turner 写道: On 21/11/11 10:19, Zuofeng Shang wrote: Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not v

Re: [R] Searching for the first two characters of a string

2011-11-20 Thread Remko Duursma
dfr <- data.frame(txt= c("abab","ghghg","ththt","dfdfdf"), yvar=1:4) ind <- substr(dfr$txt,1,2) dfr[ind == "ab",] greetings, Remko -- View this message in context: http://r.789695.n4.nabble.com/Searching-for-the-first-two-characters-of-a-string-tp4089862p4090042.html Sent from the R help ma

[R] Inserting blank records in a barplot

2011-11-20 Thread kodar
Hi everyone, I currently do some statistics about my heart rate variability. I've a CSV file which looks like this: Date Time ts_mean_RR ts_sdnn_RR ts_mean_HR ts_sdnn_HR ts_rmssd 1 20110905 07:21:50.0 1139.829840.305352.7393 2.2824 45.7958 2 20110906 07:11:37.0 1182.7333

[R] Continuasly Compunded Returns with quantmod-data

2011-11-20 Thread barb
Hey guys, i want to calculate the continuasly compounded returns for stock prices. Formula for CCR: R_t = ln(P_t/P_{t-1})*100 With R: First i have to modify the vectors, so that they have the same length and we start at the second observation. log(GOOG1[-1]/GOOG1[1:length(GOOG1)-1])*100

[R] Adding two or more columns of a data frame for each row when NAs are present.

2011-11-20 Thread Ian Strang
I am fairly new to R and would like help with the problem below. I am trying to sum and count several rows in the data frame yy below. All works well as in example 1. When I try to add the columns, with an NA in Q21, I get as NA as mySum. I would like NA to be treated as O, or igored. I wrote

Re: [R] Using GIS data in R

2011-11-20 Thread Zuofeng Shang
Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not very clear. The context is as follows. I have a set of locations with coordinates (latitude and longitude) from Texas region. Some of the locations are within Texas while some of them are not. I am trying to find thos

[R] Cox proportional hazards confidence intervals

2011-11-20 Thread Paul Johnston
I am calculating cox propotional hazards models with the coxph function from the survival package. My data relates to failure of various types of endovascular interventions. I can successfully obtain the LR, Wald, and Score test p-values from the coxph.object, as well as the hazard ratio as follo

Re: [R] Data analysis: normal approximation for binomial

2011-11-20 Thread Colstat
Hey, Joshua Thank so much for your quick response. Those examples you produced are very good, I'm pretty impressed by the graphs. When I ran the last line, I hit an error, so I ran what's inside summary(), it give me Error: could not find function "lmer" Something with the package "lme4"? Colin

[R] Searching for the first two characters of a string

2011-11-20 Thread aclinard
Hi, I'm trying to search the data in a column for the first two characters, and return all rows that match the search criteria. Any suggestions? Thanx -- View this message in context: http://r.789695.n4.nabble.com/Searching-for-the-first-two-characters-of-a-string-tp4089862p4089862.html Sent

[R] rJava and multicore

2011-11-20 Thread James McCreight
Hello MasteRs- Because I want to parallelize several calls to the glmulti package, what I'm essentially doing is trying to parallelize different calls to rJava. I'm using plyr functions which use foreach and then doMC which means multicore is my backend for parallelizing. I've tried several appro

[R] Setting hostname in the .Renvironment

2011-11-20 Thread Jonathan Greenberg
This is a follow-up to a question I asked a few years back. We have a pair of computers that share a common home directory (and therefor a common .Renviron) with identical hardware, but very different sets of libraries such that using a "shared" R_LIBS between two computers does not work. They bo

Re: [R] Need help with table() and apply()

2011-11-20 Thread Stuart Luppescu
On 日, 2011-11-20 at 17:43 -0500, jim holtman wrote: > It might be good if you told us the problem you are trying to solve. > Why do you have factors in the dataframe? Can you just have the > values? Do you want to count the 'levels' of the factors in a row, or > do you want to count the numeric t

Re: [R] Need help with table() and apply()

2011-11-20 Thread jim holtman
It might be good if you told us the problem you are trying to solve. Why do you have factors in the dataframe? Can you just have the values? Do you want to count the 'levels' of the factors in a row, or do you want to count the numeric they represent (in your case it is the same, so I wonder why

Re: [R] Need help with table() and apply()

2011-11-20 Thread jim holtman
The answer to your question as to why you had to convert back to factors is that you "undid" the factors when you did the 'cbind' to create the dataframe. Here is what you should have done: > df <- data.frame(rating.1 , rating.2 , rating.3 , rating.4 , + rating.5 , rating

[R] Need help with table() and apply()

2011-11-20 Thread Stuart Luppescu
Hello, I am having trouble getting counts of values in rows of a data frame. I'm trying to use apply, but it's not working. This gives a sample of the kind of data I'm working with: rating.1 <- factor(sample(1:4, size=10, replace=T), levels=1:4) rating.2 <- factor(sample(1:4, size=10, replace=T),

Re: [R] Using GIS data in R

2011-11-20 Thread Rolf Turner
On 21/11/11 10:19, Zuofeng Shang wrote: Hi Rolf, Thanks very much for suggestions! Sorry if I made my question not very clear. The context is as follows. I have a set of locations with coordinates (latitude and longitude) from Texas region. Some of the locations are within Texas while some

Re: [R] Using GIS data in R

2011-11-20 Thread Rolf Turner
On 21/11/11 08:01, JeffND wrote: Hi Rolf, I have a similar question. I want to test whether a point with certain coordinates is inside a state, say Texas. It seems that inside.owin() only works for testing if a point lies in a regular region, say a polygon. Since Texas has irregular boundary, ho

[R] I'm writing this letter to enquire where can I download the package of "lmtest".

2011-11-20 Thread Sophy
Dear editor: I'm writing this letter to enquire where can I download the package of "lmtest". Can you send me this package? THanks a lot. Best regards, Shu-Fei Wu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] I'm writing this letter to enquire where can I download the package of "lmtest".

2011-11-20 Thread R. Michael Weylandt
http://cran.r-project.org/web/packages/lmtest/index.html Or automatically within R by typing: install.packages("lmtest") Michael On Sun, Nov 20, 2011 at 1:18 PM, Sophy <100...@mail.tku.edu.tw> wrote: > Dear editor: >   I'm writing this letter to enquire where can I download the package of > "l

Re: [R] Using GIS data in R

2011-11-20 Thread JeffND
Hi Rolf, I have a similar question. I want to test whether a point with certain coordinates is inside a state, say Texas. It seems that inside.owin() only works for testing if a point lies in a regular region, say a polygon. Since Texas has irregular boundary, how do we achieve this? Or there is

Re: [R] Transformations

2011-11-20 Thread David Winsemius
On Nov 20, 2011, at 11:16 AM, d.s91 wrote: Hi, I'm having some trouble with R code for one of my assignment questions on transforms. I've never used R for transformations so I'm not sure where to being. Our prof did give us some partial R code.par(mfrow=c(2,2)) plot(X[,2],e) plot(X[,3],e) p

Re: [R] logistic regression by glm

2011-11-20 Thread 屠鞠传礼
Thank you Ligges :) one more question: my response value "diagnostic" have 4 levels (0, 1, 2 and 3), so I use it like this: "as.factor(diagnostic) ~ as.factor(7161521) +as.factor(2281517) " Is it all right? ÔÚ 2011-11-20 23:45:23£¬"Uwe Ligges" дµÀ£º > > >On 20.11.2011 12:46, tujchl wrote: >

Re: [R] logistic regression by glm

2011-11-20 Thread 屠鞠传礼
I worried it too, Do you have idear that what tools I can use? ÔÚ 2011-11-21 00:13:26£¬"Uwe Ligges" дµÀ£º > > >On 20.11.2011 16:58, ÍÀ¾Ï´«Àñ wrote: >> Thank you Ligges :) >> one more question: >> my response value "diagnostic" have 4 levels (0, 1, 2 and 3), so I use it >> like this: >> "as.

[R] Transformations

2011-11-20 Thread d.s91
Hi, I'm having some trouble with R code for one of my assignment questions on transforms. I've never used R for transformations so I'm not sure where to being. Our prof did give us some partial R code.par(mfrow=c(2,2)) plot(X[,2],e) plot(X[,3],e) plot(X[,4],e) plot(X[,5],e) Any help ?? 3. T

Re: [R] logistic regression by glm

2011-11-20 Thread Uwe Ligges
On 20.11.2011 17:27, 屠鞠传礼 wrote: I worried it too, Do you have idear that what tools I can use? Depends on your aims - what you want to do with the fitted model. A multinomial model, some kind of discriminant analysis (lda, qda), tree based methods, svm and so son come to mind. You probably

Re: [R] logistic regression by glm

2011-11-20 Thread Uwe Ligges
On 20.11.2011 16:58, 屠鞠传礼 wrote: Thank you Ligges :) one more question: my response value "diagnostic" have 4 levels (0, 1, 2 and 3), so I use it like this: "as.factor(diagnostic) ~ as.factor(7161521) +as.factor(2281517)" Is it all right? Uhh. 4 levels? Than I doubt logistic regression is t

Re: [R] place values into a matrix efficiently?

2011-11-20 Thread Carl Witthoft
Excellent. That's what I was looking for. Thanks, Rolf. Carl On 11/19/11 11:16 PM, Rolf Turner wrote: On 20/11/11 16:27, Carl Witthoft wrote: This question attacked me as I was thinking about matrix value updates. I probably will never need to do this, but wanted to ask if there are efficien

Re: [R] ANOVA and LSD TEST - contrasting results

2011-11-20 Thread Roberto
I didn't meant to rewrite textbook. I asked only for a clarification to my doubt, because I have started to study statistic recently. -- View this message in context: http://r.789695.n4.nabble.com/ANOVA-and-LSD-TEST-contrasting-results-tp4086090p4088810.html Sent from the R help mailing list arch

Re: [R] create variable names using paste

2011-11-20 Thread Uwe Ligges
On 20.11.2011 15:32, Alaios wrote: Dear all, I would like based on a variable values, like threshold<- 90 to create variables name that will load data sets For example paste('mystring',threshold,sep="")<-load('myfile') This is a FAQ! You probably want to assign into a list. But if you rea

Re: [R] logistic regression by glm

2011-11-20 Thread Uwe Ligges
On 20.11.2011 12:46, tujchl wrote: HI I use glm in R to do logistic regression. and treat both response and predictor as factor In my first try: *** Call: glm(formula = as.factor(diagnostic) ~ as.factor(7161521) + as.

Re: [R] alpha_1 + beta_1 >1 in GARCH(1,1)

2011-11-20 Thread Patrick Burns
This would have been a more appropriate question on r-sig-finance. The short answer is: no, you can't trust the coefficients. You don't say how much data you have, but this situation is common when you don't have much data (meaning fewer than 2000 daily observations). The sum of those two param

Re: [R] ANOVA and LSD TEST - contrasting results

2011-11-20 Thread peter dalgaard
On Nov 19, 2011, at 15:37 , Roberto wrote: > First of all, thank you for the reply to my topic. > > Anova summary has shown no significative difference into Treatment (Pr > 0.374), otherwise LSD Test has shown difference between 2 Treatment. > I suppose that's something strange. > It isn't. Yo

[R] create variable names using paste

2011-11-20 Thread Alaios
Dear all, I would like based on a variable values, like threshold<- 90 to create variables name that will load data sets For example paste('mystring',threshold,sep="")<-load('myfile') How I can doi something like that in R? B.R Alex [[alternative HTML version deleted]] _

Re: [R] ltm: Simplified approach to bootstrapping 2PL-Models?

2011-11-20 Thread Dimitris Rizopoulos
Note that you can also fit 2PL models using the gpcm() function that fits the Generalized Partial Credit Model, and therefore you can use the GoF.gpcm() function for goodness-of-fit, e.g., library(ltm) fit2PL.1 <- ltm(LSAT ~ z1) fit2PL.2 <- gpcm(LSAT) fit2PL.1 fit2PL.2 GoF.gpcm(fit2PL.2, B =

Re: [R] Data analysis: normal approximation for binomial

2011-11-20 Thread John Kane
Hi Colin, I'm no statistician and it's been a very long time but IIRC a t-test is a 'modified version of a x-test that is used on small sample sizes. (I can hear some of our statistians screaming in the background as I type.) In any case I thing a Z distribution is descrete and a standard norm

[R] logistic regression by glm

2011-11-20 Thread tujchl
HI I use glm in R to do logistic regression. and treat both response and predictor as factor In my first try: *** Call: glm(formula = as.factor(diagnostic) ~ as.factor(7161521) + as.factor(2281517), family = binomial())

[R] ltm: Simplified approach to bootstrapping 2PL-Models?

2011-11-20 Thread Christian Montel
Dear R-List, to assess the model fit for 2PL-models, I tried to mimic the bootstrap-approach chosen in the GoF.rasch()-function. Not being a statistician, I was wondering whether the following simplification (omit the "chi-squared-expressed model fit-step") would be appropriate: GoF.ltm <- funct

[R] ltm: Simplified approach to bootstrapping 2PL-Models?

2011-11-20 Thread Christian Montel
Dear R-List, to assess the model fit for 2PL-models, I tried to mimic the bootstrap-approach chosen in the GoF.rasch()-function. Not being a statistician, I was wondering whether the following simplification (omit the "chi-squared-expressed model fit-step") would be appropriate: GoF.ltm <- funct

[R] anova to pca

2011-11-20 Thread Giovanni Azua
Hello, I would like to reinforce my anova results using PCA i.e. which factor are most important because they explain most of the variance (i.e. signal) of my 2^k*r experiment. However, I get the following error while trying to run PCA: > throughput.prcomp <- > prcomp(~No_databases+Partitionin

[R] alpha_1 + beta_1 >1 in GARCH(1,1)

2011-11-20 Thread user84
Hi, as i suppose to know in a stationary GARCH(1,1) model the sum of alpha and beta has to be smaller than 1. But if i use the garchfit() function from the package fGarch for my timeseries the sum is bigger than 1. The adf.test tells me a p-value smaller than 0.01 instead. What does this mean for