Re: [R] help in preparing data for using the package SURVEY

2016-08-25 Thread David Winsemius
> On Aug 25, 2016, at 10:18 AM, David Remotti wrote: > > hello all, and thanks in advance for any eventual help. > I'am quite new to R, and want to use the package SURVEY to calculate results > from a sampling. First: It is spelled "survey" > I have installed the package and started studying

Re: [R] Storing business hours

2016-08-25 Thread William Dunlap via R-help
If you label opening times with +1 and closing times with -1 then cumsum(thoseLabels) will tell you how many shops are open immediately after each of those times. You can use findInterval() on the times to map an arbitrary time to the number of shops open at that time. You do need to deal with st

Re: [R] Storing business hours

2016-08-25 Thread Jim Lemon
Hi Alexander, A time series comes to mind, but perhaps all you need is a matrix with 0s for closed and 1s for open. Each row is a shop. Column names as the times and the resolution is up to you. I think colSums will produce what you want. Jim On Fri, Aug 26, 2016 at 1:10 AM, alexander.som...@tu-d

[R] Scale and shape parameters of Gamma mixture distributions

2016-08-25 Thread Marine Regis
Hello, I used the function "mix" (package "mixdist'') to fit Gamma mixture distributions. The function gives mu and sigma parameters (output below). How can I find the scale and shape parameters of the Gamma distributions ? Parameters: pimu sigma 1 0.2089 185.7 285.4 2 0.7911 530.1

Re: [R] Importint stata file and using value labels

2016-08-25 Thread Juan Ceccarelli Arias
Mmm...The other option working with R for importing the dta file but obtaining the values and deleting or ignoring the value labels. I think some time ago i did that, but now i can't remember it. On Thu, Aug 25, 2016 at 4:11 PM, wrote: > So you should do > > table(region[sex=="Hombre"],type[se

[R] Invitation to visualization user study

2016-08-25 Thread Sara Johansson Fernstad
Dear R-users, We are currently conducting a user study evaluating visualization methods from the R-package VIM (https://cran.r-project.org/web/packages/VIM/VIM.pdf) in the context of displaying missing data. Our aim is to evaluate what type of visualization may be best for solving particular task

Re: [R] Importint stata file and using value labels

2016-08-25 Thread Juan Ceccarelli Arias
> str(sex) Factor w/ 2 levels "Hombre","Mujer": 1 2 2 1 2 2 1 1 1 1 ... On Thu, Aug 25, 2016 at 1:42 PM, wrote: > Maybe sex is a factor and Man its label. Factors are coded internally as > integers, to see it use > > str(sex) > > Rui Barradas > > > Citando Juan Ceccarelli Arias : > > Nop. I did

[R] help in preparing data for using the package SURVEY

2016-08-25 Thread David Remotti
hello all, and thanks in advance for any eventual help. I'am quite new to R, and want to use the package SURVEY to calculate results from a sampling. I have installed the package and started studying it, but I find difficulties in understanding how to prepare my data (I actually have them in a

Re: [R] Importint stata file and using value labels

2016-08-25 Thread ruipbarradas
So you should do table(region[sex=="Hombre"],type[sex=="Hombre"] Rui Barradas   Citando Juan Ceccarelli Arias : str(sex)  Factor w/ 2 levels "Hombre","Mujer": 1 2 2 1 2 2 1 1 1 1 ...   On Thu, Aug 25, 2016 at 1:42 PM, wrote: _Maybe sex is a factor and Man its label. Factors are coded inte

Re: [R] Importint stata file and using value labels

2016-08-25 Thread Jeff Newmiller
You need to (re-)read the "Introduction to R" document that comes with R. R Is not Stata, and you should not expect R to look syntactically like Stata. Note that if you, against normal R convention, wish to manipulate the integers that a factor is implemented with, you can create such a variabl

Re: [R] Importint stata file and using value labels

2016-08-25 Thread ruipbarradas
Maybe sex is a factor and Man its label. Factors are coded internally as integers, to see it use str(sex) Rui Barradas   Citando Juan Ceccarelli Arias : > Nop. I didn't work. But using the following it does work. > table(region[sex=="Men"],type[sex=="Men"]) > When i use the dta file with stat

Re: [R] Importint stata file and using value labels

2016-08-25 Thread Juan Ceccarelli Arias
Nop. I didn't work. But using the following it does work. table(region[sex=="Men"],type[sex=="Men"]) When i use the dta file with stata i declare the condition with sex==1 and not sex=="Man". On Thu, Aug 25, 2016 at 12:39 PM, wrote: > Hello, > > Try instead > > table(region[sex==1],type[sex==1])

[R] Storing business hours

2016-08-25 Thread alexander.som...@tu-dortmund.de
Hi fellow R-users, I am wondering about the best way to store business hours and the like in R. (Best in the sense of best for analyzing them.) Say, I got a number of “shops”: Shop A opens at 8am and closes at 8pm; shop B opens at 9am, closes at 11.45am for a siesta, reopens at 1.30pm and close

Re: [R] Importint stata file and using value labels

2016-08-25 Thread ruipbarradas
Hello, Try instead table(region[sex==1],type[sex==1]) To test for equality use == not =. Hope this helps, Rui Barradas   Citando Juan Ceccarelli Arias : > Hi > Im a bit lost. > Ive imported a stata13 file. When i try to make a simple > table(region[sex=1],type[sex=1]) > i get something as >

[R] Importint stata file and using value labels

2016-08-25 Thread Juan Ceccarelli Arias
Hi Im a bit lost. Ive imported a stata13 file. When i try to make a simple table(region[sex=1],type[sex=1]) i get something as type1 type2 region1 0 0 region2 0 0 region3 0 0 I don't know how to operate with the value labels. Sex is defined as 1 as "Man" and 2 as "Female". And region1 i

[R] nlme: fewer observations than random effects in all level 1 groups

2016-08-25 Thread John Sorkin
I am getting a warning message when I run lme: Warning message: In lme.formula(fixed = value ~ CorT + time + CorT * time, data = GD) : fewer observations than random effects in all level 1 groups I don't know what the message means, nor if I need to be concerned about the message. I would be g

[R] Hickman models with two binary dependent variables in R

2016-08-25 Thread Faradj Koliev
Hi everyone, How do I run Heckman models in R with two binary dependent variables? sampleSelection package in R works with standard heckman models ( binary DV for the selection equation and continuous DV for the outcome equation). In my case dependent variables are both binary (actually order

[R] Course: Introduction to Regression Models with Spatial and Temporal Correlation

2016-08-25 Thread Highland Statistics Ltd
We would like to announce the following statistics course: Course: Introduction to Regression Models with Spatial and Temporal Correlation Where: Lisbon, Portugal When: 20-24 February 2017 Course website: http://www.highstat.com/statscourse.htm Course flyer: http://highstat.com/Courses/Flyer

Re: [R] lme to determine if there is a group effect

2016-08-25 Thread Thierry Onkelinx
Dear John, lme() not longer requires a GroupedData object. You can directly use a data.frame which is easier to specify different models. You want something like lme(value ~ time * group, random = ~ time|SS, data = data1) PS Note that the R-Sig-mixedmodels is more suited for this kind of questi