[R] unit root test

2016-07-13 Thread farzana akbari
in thr name of God Hi Dear i try to test unit root of eff1 in my panel data = data1 but this is the eroor what should i do ? purtest(eff1~1,data=data1,index="indu",pmax=4,test="levinlin") Error in purtest(eff1 ~ 1, data = data1, index = "indu", pmax = 4, test = "levinlin") : the individual

Re: [R] About "SpatioTemporal" Package

2016-07-13 Thread Jim Lemon
Hi Elham, The data might have been read in as a factor, which is neither character nor numeric. In any case, it seems more likely to be a problem with the "createSTdata" function, which I don't have. Jim On Thu, Jul 14, 2016 at 1:01 PM, Elham Daadmehr wrote: > Thank you

Re: [R] About "SpatioTemporal" Package

2016-07-13 Thread Elham Daadmehr via R-help
Thank you for the reply, Jim. It gave me the same error. I checked the example data "mesa.data.raw" in this package, I found that the "ID" has the same type as the one in this data but I don't know why the function "createSTdata(y1, datst1)" give me the error. Regards, On Thursday, July

[R] glmmLasso with interactions errors

2016-07-13 Thread Walker Pedersen
Hi Everyone, I am having trouble running glmmLasso. An abbreviated version of my dataset is here: https://drive.google.com/open?id=0B_LliPDGUoZbVVFQS2VOV3hGN3c Activity is a measure of brain activity, Novelty and Valence are categorical variables coding the type of stimulus used to elicit the

Re: [R] Lake Analyzer Help

2016-07-13 Thread Kyle Wittmaier
Below is the code that was used. The packages that were included are rLakeAnalyzer, lattice, matrix, manipulate. The same script and data files works perfectly on a colleagues computer. On my computer it runs fine with no error messages however there gaps in the plots that it produces. Any help

[R] Reference for aov()

2016-07-13 Thread Justin Thong
Hi *I have been looking for a reference to explain how R uses the aov command(at a deeper level)*. More specifically, how R reads the formulae and R computes the sums of squares. I am not interested in understanding what the difference of Type 1,2,3 sum of squares are. I am more interested in

Re: [R] Lake Analyzer Help

2016-07-13 Thread Jim Lemon
Hi Kyle, First, see if you can identify which data are getting lost. This will often reveal what is losing them if there is some common characteristic. If not, try to create some toy data (a puddle, not a lake) that will produce the same problem. Then send an email with the toy data as formatted

Re: [R] About "SpatioTemporal" Package

2016-07-13 Thread Jim Lemon
Hi Elham, It looks to me as though you have created the numeric variable "ID" and then passed it to a function that expects it to be a character variable. Try changing the line: ID<-60101:60128 to: ID<-paste("ID",60101:60128,sep="") and see what happens. Jim On Wed, Jul 13, 2016 at 8:29 PM,

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread Jeff Newmiller
The formula interface as used in lm and nls searches for separate coefficients for each variable.. it will take someone more clever than I to figure out how to get the formula interface to think of two variables as instances of one factor. However, R can do nonlinear optimization just fine:

Re: [R] Linear model vs Mixed model

2016-07-13 Thread Utkarsh Singhal
Thanks Brian for all your kind help. "didn't mean to imply that the different parameterization of the contrasts would make the lm estimates agree more with the lmer estimates, only that it might be easier to compare the regression summary output to see how similar/dissimilar they were ". Got it

Re: [R-es] par() y ggplot2

2016-07-13 Thread Víctor Granda García
Hola Mauricio y demás en la lista, Yo desde que descubrí el paquete *cowplot* ( https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html) hago todas las gráficas en ggplot y luego uso cowplot para hacer lo que antes con par o con las soluciones de los enlaces que te propone

Re: [R] Linear model vs Mixed model

2016-07-13 Thread Cade, Brian
Utkarsh: I think the differences between the lm and lmer estimates of the intercept are consistent with the regularization effect expected with mixed-effects models where the estimates shrink towards the mean slightly. I don't think there is any reason to expect exact agreement between the lm and

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread David Winsemius
> On Jul 13, 2016, at 8:01 AM, David Winsemius wrote: > > >> On Jul 13, 2016, at 6:48 AM, stn021 wrote: >> >> Hello, >> >> so here a numerical example in R-code. Code is appended below. >> >> The output should be >> 1) the numerical values of the

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread stn021
> Is this what is intended? > >> observed_data$p1ab <- persons$ability[ match(observed_data$p1, persons$name) >> ] >> observed_data$p2ab <- persons$ability[ match(observed_data$p2, persons$name) >> ] Hello David, thank you for your answer. The code in my previous post was intended as an

Re: [R] Linear model vs Mixed model

2016-07-13 Thread Utkarsh Singhal
Hi Brian, This makes some sense to me theoretically, but doesn't pan out with my experiment. The contrasts default was the following as you said: > options("contrasts") $contrasts unordered ordered "contr.treatment" "contr.poly" I changed it as follows: >

[R] Dates in R (Year Month)

2016-07-13 Thread Mangalani Peter Makananisa
Hi All, I am trying to convert the vector below to dates please assist I have tried to use information on the links you sent, but it is not working. X = c(201501, 201502, 201503, 201505, 201506, 201507, 201508, 201509, 201510, 201511, 201512, 201601, 201602, 201603, 201604, 201605, 201606)

Re: [R] Dates in R (Year Month)

2016-07-13 Thread David L Carlson
You need to look at the examples on the manual pages for ?yearmon and ?strptime: > Z <- as.yearmon(as.character(X), "%Y%m") > Z [1] "Jan 2015" "Feb 2015" "Mar 2015" "May 2015" "Jun 2015" "Jul 2015" "Aug 2015" [8] "Sep 2015" "Oct 2015" "Nov 2015" "Dec 2015" "Jan 2016" "Feb 2016" "Mar 2016"

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread David Winsemius
> On Jul 13, 2016, at 6:48 AM, stn021 wrote: > > Hello, > > so here a numerical example in R-code. Code is appended below. > > The output should be > 1) the numerical values of the abilities of the persons > 2) the multiplyer > > > Please note that > > 1) I have used

Re: [R] Dates in R (Year Month)

2016-07-13 Thread Ismail SEZEN
You can not convert numeric vectors directly to yearmon object. You must convert the X variable to character and add “-“ between year and month. Then as.yearmon function will work properly. Please, read help pages of ?as.character, ?strptime and ?as.yearmon. Example: > library(zoo) > aaa <-

Re: [R] Lake Analyzer Help

2016-07-13 Thread Thierry Onkelinx
Please keep the mailing list in cc. See http://adv-r.had.co.nz/Reproducibility.html for some instructions. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25

Re: [R] Lake Analyzer Help

2016-07-13 Thread Thierry Onkelinx
This will be very hard to answer without a reproducible example. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the

Re: [R] Aggregate rainfall data

2016-07-13 Thread David Winsemius
> On Jul 13, 2016, at 3:21 AM, roslinazairimah zakaria > wrote: > > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > > I tried : balok <- cbind(balok3[,-5], balok3$Rain.mm[balok3$Rain.mm==0.0?] <- > NA) If you had done as I suggested,

Re: [R] [FORGED] Regression with factors ?

2016-07-13 Thread stn021
Hello, so here a numerical example in R-code. Code is appended below. The output should be 1) the numerical values of the abilities of the persons 2) the multiplyer Please note that 1) I have used non-linear optimization to solve this problem and got the expected result, though not with R but

[R] About "SpatioTemporal" Package

2016-07-13 Thread Elham Daadmehr via R-help
  Dear all,  I want to build the data with the structure of STdata (using the function "createSTdata()"), I did as the following: datst=cbind(xy) yy=cbind(y,xx) ID=60101:60128 date=as.numeric(1:13) y1=as.data.frame(t(cbind(yy))) datst1=as.data.frame(cbind(ID,datst))

[R] CensMixReg package - clarifications and working example

2016-07-13 Thread Ilaria Pascucci
Dear All, I am relatively new to R but I am very interested in using some of the available packages for astronomical applications. While I have been able to understand and use other packages like cenken, I have some difficulties with CensMixReg. Here are the specifics (with info on R

[R] Lake Analyzer Help

2016-07-13 Thread Kyle Wittmaier
I am using LakeAnalyzer in Rstudio to produce heat maps and plots using data from constant monitoring buoys. I have a prewritten script that is functioning on a colleagues computer perfectly. I am using Rstudio 0.99.902 and R 3.3.1. I have added four packages to the project (lattice, manipulate,

Re: [R] pairwise deletion in regression models

2016-07-13 Thread Fox, John
Dear Petr and Adel, I'm unaware of any R software that does "pairwise deletion" of missing data (that is, uses pairwise-complete cases). It's possible to compute LS regression from covariances and means (or, equivalently, correlations, standard deviations, and means), which makes this approach

Re: [R] Forking and adapting an R package

2016-07-13 Thread Adams, Jean
Timo, A couple of thoughts ... First, could you achieve what you want by simply modifying (your own copies of) a function or two from the hexbin package, without having to modify the entire package? This might give you fewer tripping points. Second, right after you forked the package (so that

Re: [R] Aggregate rainfall data

2016-07-13 Thread PIKAL Petr
Hi First you could check what levels are not numeric by levels(balok3$Rain.mm) If only 0.0? is the offending level you can either change it to 0 by levels(balok3$Rain.mm)[number of ofending level] <- "0.0" and then change the factor to numeric by balok3$Rain.mm <-

Re: [R] pairwise deletion in regression models

2016-07-13 Thread PIKAL Petr
Hi maybe others can give you definitive answer see my comments in line From: adelda...@gmail.com [mailto:adelda...@gmail.com] On Behalf Of Adel Daoud Sent: Wednesday, July 13, 2016 1:42 PM To: PIKAL Petr Cc: r-help Subject: Re: [R] pairwise

Re: [R] graph: horizontal bar reflecting number of data

2016-07-13 Thread Jim Lemon
Hi Tagmarie, This might help: datframe$numberdata<-as.numeric(as.character(datframe$numberdat)) library(plotrix) barcol<-color.scale(datframe$numberdat,extremes=c("black","white")) barplot(matrix(datframe$numberdat,nrow=2,byrow=TRUE), beside=TRUE, horiz=TRUE,names.arg=paste("Week",1:3),

Re: [R] pairwise deletion in regression models

2016-07-13 Thread Adel Daoud
Hi Yes, I am sure. Have a look here for SPSS e.g.: http://www-01.ibm.com/support/docview.wss?uid=swg21475199 and here http://www.ats.ucla.edu/stat/spss/modules/missing.htm and for STATA here, http://www.ats.ucla.edu/stat/stata/modules/missing.html I know that R allows for pairwise

Re: [R] Aggregate rainfall data

2016-07-13 Thread boB Rudis
use `gsub()` after the `as.character()` conversion to remove everything but valid numeric components from the strings. On Wed, Jul 13, 2016 at 6:21 AM, roslinazairimah zakaria wrote: > Dear David, > > I got your point. How do I remove the data that contain "0.0?". > > I

Re: [R] Aggregate rainfall data

2016-07-13 Thread roslinazairimah zakaria
Dear David, I got your point. How do I remove the data that contain "0.0?". I tried : balok <- cbind(balok3[,-5], balok3$Rain.mm[balok3$Rain.mm==0.0?] <- NA) However all the Rain.mm column all become NA. day month year Time balok3$Rain.mm[balok3$Rain.mm == "0.0?"] <- NA 1 30 7

Re: [R] pairwise deletion in regression models

2016-07-13 Thread PIKAL Petr
Hi Hm. Are you 100% sure that other software packages can do pairwise deletion in OLS or GLM? I am not at all familiar with them but http://www.ats.ucla.edu/stat/spss/modules/stats.htm suggests that option pairwise is available with corr and I believe the same option exists in cor function in

[R] graph: horizontal bar reflecting number of data

2016-07-13 Thread Dagmar
Dear all, I hope someone can help with my problem: I have a dataframe like this: datframe <- data.frame(Name=c("Kati","Kati","Kati","Leon","Leon","Leon" ), week =c("1","2", "3", "1","2", "3"), numberdata =c("5","12", "1", "6","2", "5")) datframe I want to create a graph like the attached

Re: [R] pairwise deletion in regression models

2016-07-13 Thread Adel Daoud
Thanks Petr for the suggestion. I just took the regtools package for a quick test drive. It looks promising, but it still needs further development to make it a viable option. You will not get a standard regression output (as in lm or glm), only the regression coefficients (without standard

Re: [R] pairwise deletion in regression models

2016-07-13 Thread PIKAL Petr
Hi http://stats.stackexchange.com/questions/158366/fit-multiple-regression-model-with-pairwise-deletion-or-on-a-correlation-covari The package is probably not available on CRAN but seems to be still maintained on github. Cheers Petr > -Original Message- > From: R-help