[R] Bayesian 95% Credible interval

2014-03-26 Thread Baran rad
hi :) if i using importance sampling for obtain postreior density, can i use teachingdemos for obtain hpd interval?what are you doing with weight? or is other package for cmpute this type of sampling? please help me soon as soon [[alternative HTML version deleted]] ___

[R] R autocompletion configuration

2014-03-26 Thread Stas Malavin
Dear R-users, I experimented with readLine settings ('~/.inputrc') and then restored the file, but R still behaves like if '.inputrc' is modified. '/etc/inputrc' is also fine. I suppose there're some separate R-specific configuration files. Could you please kindly advise how to get things back?

Re: [R] kmeans function

2014-03-26 Thread Prof Brian Ripley
On 26/03/2014 20:01, Tomassini, Letizia wrote: I would like to understand why the fastclus procedure in SAS is affected by the initial order of the data. So, with the same dataset, but sorted in a different way, I get different clusters rearrangements. I find this really disturbing. R seems to

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

2014-03-26 Thread Xu Wang
On Sat, Jul 16, 2011 at 10:26 AM, Roberto Molinari wrote: > > Dear R users, > > I am currently using the locpoly function from the KernSmooth package to > estimate densities. However, I have some trouble understanding how this > estimation technique is implemented in R. My main concern comes fro

Re: [R] reading dataset

2014-03-26 Thread Pascal Oettli
Hello, Some hints: - for the year 1961, the total number of values is 27594000, - there are 180 longitudes and 140 latitudes, - there are 365 days, - there are 3 variables, Compare the total number of values and the result of (180 x 140 x 365 x 3). The order is "precip", "rstn", "fla

Re: [R] reading dataset

2014-03-26 Thread Jeff Newmiller
This question is about a specific data set you found on the internet... it is not in any way a question about R. You should be asking the suppliers of this data, not us. --- Jeff NewmillerThe .

Re: [R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Jeff Newmiller
Please keep the mailing list included by using "reply-all"... I am not doing this as a private consultation. Your sample data is a step forward, but it is still not reproducible. You could Google "R reproducible example" and find http://stackoverflow.com/questions/5963269/how-to-make-a-great-r

Re: [R] how to do ARIMA prediction with high performance

2014-03-26 Thread ce
I think rugarch package is doing what you need . Also it uses cluster option to increase performance : http://www.unstarched.net/r-examples/rugarch/a-short-introduction-to-the-rugarch-package/ -Original Message- From: "cyl123" [505186...@qq.com] Date: 03/26/2014 09:43 PM To: "r-help"

[R] how to do ARIMA prediction with high performance

2014-03-26 Thread cyl123
Hi, I need to process a data stream using ARIMA model in real-time, that is : I need to build a ARIMA model and do prediction in every 1 minute using a slide window with 200 samples . To improve the performance of prediction, what I plan to do is: 1) to build ARIMA model using some history

[R] reading dataset

2014-03-26 Thread eliza botto
Dear useRs, A similar question has previously been asked by another user (https://stat.ethz.ch/pipermail/r-sig-geo/2011-September/012791.html) but i'll try to discuss it from another angle. Its about data reading. I am trying to read to read a data-set APHRO_MA_050deg_V1101R2.1961.gz from http:

Re: [R] kmeans function

2014-03-26 Thread Tomassini, Letizia
I would like to understand why the fastclus procedure in SAS is affected by the initial order of the data. So, with the same dataset, but sorted in a different way, I get different clusters rearrangements. I find this really disturbing. R seems to find the stable solution with the use of nstart=

[R] acf(ts.union()): Missing Values in Object

2014-03-26 Thread Rich Shepard
I have 2 time series (class 'ts') and I want to plot the acf for each and the joint ccf using acf(ts.union(ts1, ts2)). According to the ts.union help, "‘ts.union’ pads with ‘NA’s to the total time coverage" but the problem seems to be that one series has a single NA while the other has 2 NAs.

Re: [R] dummy coding problem

2014-03-26 Thread David Winsemius
On Mar 26, 2014, at 11:34 AM, Si Qi L. wrote: > Hi, I have got a problem with dummy coding and I really couldn't figure it > out. Would you please help me out? this is my codes: > > idx<-sort(unique(Employment.time$V1)); > dummy <- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) > > f

Re: [R] dummy coding problem

2014-03-26 Thread Jim Lemon
On 03/27/2014 05:34 AM, Si Qi L. wrote: Hi, I have got a problem with dummy coding and I really couldn't figure it out. Would you please help me out? this is my codes: idx<-sort(unique(Employment.time$V1)); dummy<- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) for (i in 1:nrow(Emplo

Re: [R] R mail list archive Google search function not work

2014-03-26 Thread Marc Schwartz
On Mar 26, 2014, at 4:14 PM, David Winsemius wrote: > > On Mar 25, 2014, at 5:31 PM, Rolf Turner wrote: > >> On 26/03/14 12:51, David Winsemius wrote: >>> >>> On Mar 25, 2014, at 9:52 AM, Luo Weijun wrote: >>> Dear Robert and R project team, I notice that the Google search function

Re: [R] R mail list archive Google search function not work

2014-03-26 Thread David Winsemius
On Mar 25, 2014, at 5:31 PM, Rolf Turner wrote: > On 26/03/14 12:51, David Winsemius wrote: >> >> On Mar 25, 2014, at 9:52 AM, Luo Weijun wrote: >> >>> Dear Robert and R project team, >>> I notice that the Google search function on the R mail list archives page >>> has stopped working for quit

Re: [R] kmeans function

2014-03-26 Thread David Carlson
To add to Ranjan's reply, k-means can potentially find different results with large nstart= numbers in a large data set. But you are correct, with a large enough value, the results will be the same unless there are two solutions that have exactly the same between sum of squares (unlikely but not im

Re: [R] Residuals of tobit{AER} and testing distribution normality

2014-03-26 Thread David Winsemius
On Mar 25, 2014, at 11:02 AM, Michal Kvasnička wrote: > Hallo. > > What are the residuals returned by resid() in this code? > > library(AER) > m <- tobit(y ~ x1 + x2, data=dat) > rr <- resid(m2, type = "response") > > Can I use them to test the normality of the random variable distribution > t

Re: [R] kmeans function

2014-03-26 Thread Ranjan Maitra
On Wed, 26 Mar 2014 18:35:34 + "Tomassini, Letizia" wrote: > > Hello > I need to ask questions about the k-means clustering function. Mainly I would > like to know why, with the use of nstart=enough number of times, kmeans > always finds the same clustering arrangements; and this happens e

Re: [R] dummy coding problem

2014-03-26 Thread Bert Gunter
No you don't. You have a problem with not learning how R works. Dummy coding is not needed in R. R uses factors instead. Read "An Introduction to R" (ships with R) or a web tutorial of your choice to learn how to work with R. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-

Re: [R] Problem with R

2014-03-26 Thread Rui Barradas
Hello, Try, at an R prompt, install.packages("lmtest", dependencies = TRUE) install.packages("betareg", dependencies = TRUE) Hope this helps, Rui Barradas Em 26-03-2014 17:44, Campaner, Fabio escreveu: Hello, I am a student at the University College of London in the Civil Engineering Depa

[R] Problem with R

2014-03-26 Thread Campaner, Fabio
Hello, I am a student at the University College of London in the Civil Engineering Department and I need to use the R program for my final year project even if I do not have any programming background. I have downloaded the program and I was following the instructions given to me by my supervi

[R] kmeans function

2014-03-26 Thread Tomassini, Letizia
Hello I need to ask questions about the k-means clustering function. Mainly I would like to know why, with the use of nstart=enough number of times, kmeans always finds the same clustering arrangements; and this happens even when the input dataset is sorted in different ways or I take out few o

[R] dummy coding problem

2014-03-26 Thread Si Qi L.
Hi, I have got a problem with dummy coding and I really couldn't figure it out. Would you please help me out? this is my codes: idx<-sort(unique(Employment.time$V1)); dummy <- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) for (i in 1:nrow(Employment.time)) { for (j in 1:length(idx))

Re: [R] dataframe calculations based on certain values of a column

2014-03-26 Thread Noah Marconi
dplyr's group_by and mutate can create those columns for you: var1 <- c("a","b","c","a","b","c","a","b","c") var2 <- c("X","X","X","Y","Y","Y","Z","Z","Z") var3 <- c(1,2,2,5,2,6,7,4,4) df <- data.frame(var1,var2,var3) dt <- tbl_df(df) dt %.% group_by(var2) %.% mutate( div = var3[var1 =

Re: [R] lavaan fit indices & Chronbach's alphas

2014-03-26 Thread Dimitri Liakhovitski
Great, thanks. Sure, it's easy to calculate Cronbach's alpha separately... On Wed, Mar 26, 2014 at 1:36 PM, Jeremy Miles wrote: > > > > On 26 March 2014 10:13, Dimitri Liakhovitski < > dimitri.liakhovit...@gmail.com> wrote: > >> Hello! >> >> I've run SEM using lavaan and after I used summary(myf

Re: [R] lavaan fit indices & Chronbach's alphas

2014-03-26 Thread Jeremy Miles
On 26 March 2014 10:13, Dimitri Liakhovitski wrote: > Hello! > > I've run SEM using lavaan and after I used summary(myfit) I saw the > following fit indices: > > Model Chi Squared > CFI > TLI > RMSEA > SRMR > > I was wondering if these are the only fit indices lavaan produces, e.g.: > GFI > AGFI

Re: [R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Jeff Newmiller
Please read and in the future follow the Posting Guide, which requests that you provide a reproducible example... that is, a series of R statements that we can run to get us to your problem point with a small sample data set that resembles yours. Forging on anyway... The ifelse function applies

[R] lavaan fit indices & Chronbach's alphas

2014-03-26 Thread Dimitri Liakhovitski
Hello! I've run SEM using lavaan and after I used summary(myfit) I saw the following fit indices: Model Chi Squared CFI TLI RMSEA SRMR I was wondering if these are the only fit indices lavaan produces, e.g.: GFI AGFI RMR Also - does lavaan automatically estimate Chronbach's Alphas for measureme

Re: [R] dataframe calculations based on certain values of a column

2014-03-26 Thread Berend Hasselman
On 26-03-2014, at 17:09, Johannes Radinger wrote: > Hi, > > I have data in a dataframe in following structure > var1 <- c("a","b","c","a","b","c","a","b","c") > var2 <- c("X","X","X","Y","Y","Y","Z","Z","Z") > var3 <- c(1,2,2,5,2,6,7,4,4) > df <- data.frame(var1,var2,var3) > > Now I'd like to

Re: [R] dataframe calculations based on certain values of a column

2014-03-26 Thread Bert Gunter
I believe this will generalize. But check carefully! Using your example (Excellent!), use ave(): with(df,ave(seq_along(var1),var2,FUN=function(i) var3[i]/var3[i][var1[i]=="c"])) [1] 0.500 1.000 1.000 0.833 0.333 1.000 1.750 [8] 1.000 1.000 This is kind of a l

[R] How to create an ifelse statement where it matches a different data.frame variable

2014-03-26 Thread Megan Weigel
Hello, Hopefully there is an answer for this, but I need an ifelse statement that replaces and returns a value based on a different dataframe. For example: CurrentDataFrame<-ifelse(CurrentDataFrame$Name=="NA",match(CurrentDataFrame$Code with PastDataFrame$Code),replace(CurrentDataFrame$Name) with

[R] dataframe calculations based on certain values of a column

2014-03-26 Thread Johannes Radinger
Hi, I have data in a dataframe in following structure var1 <- c("a","b","c","a","b","c","a","b","c") var2 <- c("X","X","X","Y","Y","Y","Z","Z","Z") var3 <- c(1,2,2,5,2,6,7,4,4) df <- data.frame(var1,var2,var3) Now I'd like to calculate relative values of var3. This values should be relative to th

Re: [R] How to rbind() two matrices that have different column sizes?

2014-03-26 Thread Noah Marconi
Out of curiosity, what's the reason for not using plyr? If it has to do with installing the package, here's how the rbind.fill function is implemented in plyr. It may help show you what you'd like to do: plyr::rbind.fill function (...) { dfs <- list(...) if (length(dfs) == 0)

[R] [igraph] number of items to replace is not a multiple of replacement length

2014-03-26 Thread Mark Stam
I wrote a simple script to build graphs: require("RSQLite") require('igraph') drv <- dbDriver("SQLite") con <- dbConnect(drv, "case.db") dataset <- dbGetQuery(con, "select * from stream") table <- aggregate(rep(1, nrow(dataset)), by = list(identifier = dataset$actor_id, name = dataset$actor, page

Re: [R] How to rbind() two matrices that have different column sizes?

2014-03-26 Thread Jeff Newmiller
This problem is poorly defined, since the meanings of row vectors of different lengths do not naturally agree. Perhaps you are thinking of binding data frames? In any event, if you think the behaviour provided by the plyr package is what you want, why DON'T you want to use it? Further, if plyr f

Re: [R] Principal Components Loadings

2014-03-26 Thread David Carlson
Look at the results of summary(body.pc). You will see that the first component accounts for 70% of the variability. That is very large and suggests that the variables are highly correlated with one another. You could check with cor(bodysize). None of the correlations is negative and the smallest on

[R] How to rbind() two matrices that have different column sizes?

2014-03-26 Thread Babak Bastan
Hi friends I would like to rbind two matrices with different column number. How can I do that? (I dont want to use Plyr package). Is there any way except plyr? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

[R] Question about c.trellis (latticeExtra)

2014-03-26 Thread Pascal Oettli
Dear r-help mailing list readers, I am facing a problem using the "c.trellis" function from the "latticeExtra" package, to merge 2 trellis objects (1 levelplot and 1 xyplot). Using the following example, it works well without customizing the y-axis of "levObj1". But when the y-axis is customized

Re: [R] Principal Components Loadings

2014-03-26 Thread Pavneet Arora
Hello John As per your suggestion, I have now used the dput function. So my Rdata dataset "bodysize" looks like this. > dput(bodysize) structure(list(neck = c(36.2, 38.5, 34, 37.4, 34.4, 39, 36.4, 37.8, 38.1, 42.1, 38.5, 39.4, 38.4, 39.4, 40.5, 36.4, 38.9, 42.1, 38, 40, 39.1, 41.3, 33.9, 35.5,

Re: [R] How to creat a dummy coding in R? (URGENT!)

2014-03-26 Thread Jim Lemon
On 03/26/2014 05:35 AM, Si Qi L. wrote: Hi, it's so urgent that I really need your help on R. This following is part of my data, do u know how to create a dummy coding about it in R? My control group is Owner occupier. Many thanks for your big help!!!:) *AppHomeStatus* Owner occupier Living with