[R] FW: Completing Unordered Categorical missing variables using package mi

2015-06-18 Thread IOANNA IOANNOU
Hello all, A perhaps simple question. I am trying to complete unordered categorical missing data using mi package. There are two variables with missing data: Mat and Use. The problem is that the Use has several categories and somehow this means I can't plot the results as I get this error.

Re: [R] Polysomnographic data analysis with R?

2015-06-18 Thread Jim Lemon
Hi Charles, As I don't know what sort of data you are using, I can only guess. If you want to visualize the sleep patterns and events, it is fairly easy to extract these from the sleep example on the EDF format page and display them. sleep_stages-list(labels=c(Sleep stage W, Sleep stage N1,

[R] help for lay person assisting R user with disability

2015-06-18 Thread Courtney Bryant
Good Morning, I am currently working with a disabled R user who is a student here at CMU. The student has both sight and mobility issues. The student has asked for an assistant who is well versed in R to enter data for her, which we are having a hard time finding. I would like information

Re: [R] How to round only one df row how to keep 3rd sigdif if zero

2015-06-18 Thread PIKAL Petr
Hi You need to distinguish between an object and printing an object on console. When you print an object you can use several options for formating. ?sprintf, ?formatC formatC(t(a), digits=1, format=f) [,1] [,2] [,3] count 1.0 2.0 3.0 rate 16.7 33.3 50.0 Also when you transpose

Re: [R] Cross tabulation with top one variable and side as multiple variables

2015-06-18 Thread David L Carlson
They do not match because xtabs() in R produces a multidimensional array (one dimension for each variable). Looking at your spreadsheet on nabble, it appears that SPSS is just creating 4 crosstabulations with TREND against each of the other variables. That is easily done in R, but for tested

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread David L Carlson
You may have people knowledgeable about R there at Carnegie Mellon since it hosts a mirror for R software (one of 18 in the US). As Petr pointed out it is relatively easy to transfer information from an Excel spreadsheet to R by cutting and pasting (the method he suggested is for Windows

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Gabor Grothendieck
On Thu, Jun 18, 2015 at 10:32 AM, Courtney Bryant cbry...@andrew.cmu.edu wrote: Good Morning, I am currently working with a disabled R user who is a student here at CMU. The student has both sight and mobility issues. The student has asked for an assistant who is well versed in R to enter

[R] adjusted values for CI in a within-subjects design

2015-06-18 Thread Ernesto Guerra
Dear R-ers, I am trying to adjust the values of a within-items, within-subjects design (the experimental conditions are within subjects), to calculate between subjects confidence intervals (CI). I am following the recommendations from O'Brien Cousineau (2014; see also Cousineau, 2005; Morey, 2008

[R] How to round only one df row how to keep 3rd sigdif if zero

2015-06-18 Thread bcrombie
# How do I round only one row of a dataframe? # After transposing a dataframe of counts rates, all values took on the most # of signif digits in the dataset (rates), but I want counts to remain only one digit. # Also, how can I keep 3 significant digits in R when the 3rd is a zero? count - c(1,

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread PIKAL Petr
Hi I believe that others come with more elaborated answers. Probably easiest way how to transfer Excel data to R is: select rectangular area you want to transfer, preferably with sensible header. pres Ctrl-C In R enter command object - read.delim(clipboard) possibly with header or NA

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Liz Hare
Hi Courtney and John, The RStudio environment mentioned below will not work with speech output (I tried with Window-Eyes awhile ago). Some of my clients use it but I have no experience with it. Since the student is partially sighted, they might be able to customize the environment with big

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread John McKown
On Thu, Jun 18, 2015 at 9:32 AM, Courtney Bryant cbry...@andrew.cmu.edu wrote: Good Morning, I am currently working with a disabled R user who is a student here at CMU. The student has both sight and mobility issues. The student has asked for an assistant who is well versed in R to enter

Re: [R] Correlation matrix for pearson correlation (r,p,BH(FDR))

2015-06-18 Thread Rainer Schuermann
The way the sample data is provided is not useful. I have re-built your data, please find the dput() version below (and pls check whether I got it right...). This is not my area of competence at all, but from what I see from the help page is that the expected parameters are, among others: x

Re: [R] How to round only one df row how to keep 3rd sigdif if zero

2015-06-18 Thread Crombie, Burnette N
Thanks for taking the time to share your thoughts, PP. I always extensively google search before resorting to R forum. In my real dataset, not in the example I created for the forum, I had tried converting the matrix to a dataframe but it retained the unwanted format. And, these tables are

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Bert Gunter
Given that neither you nor the student are (skilled?) R users, I think you would do better contacting someone locally for help -- there will be many in the statistics and social sciences departments (among others). There are several R packages that interface with Excel (e.g. RExcel), but it may

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Duncan Murdoch
On 18/06/2015 11:32 AM, Courtney Bryant wrote: Good Morning, I am currently working with a disabled R user who is a student here at CMU. The student has both sight and mobility issues. The student has asked for an assistant who is well versed in R to enter data for her, which we are having

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Clint Bowman
Almost 20 years ago my son was in the DO-IT program at the University of Washington http://www.washington.edu/doit/. They have been very proactive in reaching out to other institutions. They have been solving problems such as yours and I suspect can suggest several workable solutions.

[R] Repeated Measures ANOVA and Missing Values in the data set

2015-06-18 Thread gianni lavaredo
I am doing Repeated Measures ANOVA with missing values. When i run my model i get this error message. *aov.out = aov(values ~ time + Error(subject/time), data=mydata2)Warning message:In aov(values ~ time + Error(subject/time), data = mydata2) : Error() model is singular* The missing Values

Re: [R] Sign of specific elements of a vector

2015-06-18 Thread David Winsemius
On Jun 18, 2015, at 1:21 PM, Marc Schwartz wrote: Just to augment Bert’s comment, other options are likely to introduce some level of overhead that while perhaps looking better, will not be materially faster. Depending upon the length of your vector, you could do some testing to see.

Re: [R] Correlation matrix for pearson correlation (r,p,BH(FDR))

2015-06-18 Thread Peter Langfelder
You have multiple options. I will advertise my own solution - install the package WGCNA, installation instructions at http://labs.genetics.ucla.edu/horvath/CoexpressionNetwork/Rpackages/WGCNA/#cranInstall then you can use the function cp = corAndPvalue(t(genes), t(features)). You need to

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Paul Murrell
Hi Jonathon Godfrey has published some information and guidelines on the accessibility of R (and other stat software), e.g., ... http://r-resources.massey.ac.nz/StatSoftware/ http://journal.r-project.org/archive/2013-1/godfrey.pdf Paul On 06/19/15 02:32, Courtney Bryant wrote: Good

[R] Sign of specific elements of a vector

2015-06-18 Thread Frank S.
Hi everyone, I have an x vector and I would want to change the sign every 20 elements. For this puspose, I wrote the following code: set.seed(1) x - rnorm(100) x x[seq(20,100, by=20)] - -x[seq(20,100, by=20)] x However, I'm afraid it is a rudimentary form to get the desired result. II

Re: [R] help for lay person assisting R user with disability

2015-06-18 Thread Courtney Bryant
Hi Liz, This is a particularly sticky case – the student is attempting to get a PhD but is currently in between programs until her current project (which we’re attempting to hire an assistant for, or better yet some up with a solution she can work on her own) is completed and “accepted” in some

[R] R problem

2015-06-18 Thread Endy
Hi, R users. I am using windows 7 ultimate, as an OS, and the R version 3.2.0. This combination creates some problems when I run R. The problem focuses on the command ‘source’. More precisely, suppose that we have a main function, let call it mainfn, which calls within it another function, call

Re: [R] Sign of specific elements of a vector

2015-06-18 Thread Marc Schwartz
Just to augment Bert’s comment, other options are likely to introduce some level of overhead that while perhaps looking better, will not be materially faster. Depending upon the length of your vector, you could do some testing to see. One thing that might yield a little bit of performance

Re: [R] Sign of specific elements of a vector

2015-06-18 Thread Bert Gunter
Your **is** the coolest and most efficient way to do this. It's vectorized -- apply() stuff is not. Cheers, Bert Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. -- Clifford Stoll On Thu, Jun 18, 2015 at 12:40 PM, Frank S.

Re: [R] R problem

2015-06-18 Thread William Dunlap
Usually, along with that error message, you get a warning that gives a few details about the problem, like the name of the file and the reason it could be opened. E.g., filename - no\\such\\file.blah.blah file(filename, r, encoding=UTF-8) Error in file(filename, r, encoding = UTF-8) :

Re: [R] Is there a convenient way of extracting the matrix `solve(X %*% t(X) + PENALTY)` from an additive model fit in mgcv?

2015-06-18 Thread Simon Wood
Yes... ## example fit... library(mgcv) set.seed(2) ## simulate some data... dat - gamSim(1,n=400,dist=normal,scale=2) b - gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat) ## extract the thing required in the title b$Vp/b$sig2 best, Simon On 18/06/15 03:23, Andrew Crane-Droesch wrote: The

Re: [R] Is there a convenient way of extracting the matrix `solve(X %*% t(X) + PENALTY)` from an additive model fit in mgcv?

2015-06-18 Thread Andrew Crane-Droesch
...That should have been obvious! I'm a little embarrassed! Thanks, Andrew ** On 06/18/2015 01:14 PM, Simon Wood wrote: Yes... ## example fit... library(mgcv) set.seed(2) ## simulate some data... dat - gamSim(1,n=400,dist=normal,scale=2) b - gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)

[R] Is there a convenient way of extracting the matrix `solve(X %*% t(X) + PENALTY)` from an additive model fit in mgcv?

2015-06-18 Thread Andrew Crane-Droesch
The title says it all. An additive model can be fit by `solve(X %*% t(X) + PENALTY)%*%t(X)%*%y` (though of course there are more efficient ways to do it). I want the matrix `solve(X %*% t(X) + PENALTY)` from a fitted gam object. GAM objects can be a bit tricky to navigate -- is there a

Re: [R] Grouping in R

2015-06-18 Thread PIKAL Petr
Hi We can only guess what you really want. Maybe this. set.seed(111) cust-sample(letters[1:5], 500, replace =T) value-sample(1:1000, 500) month-sample(1:12, 500, replace=T) dat-data.frame(cust, value, month) dat.ag-aggregate(dat$value, list(dat$month, dat$cust), sum) head(dat.ag) Group.1

Re: [R] Error bars and CI

2015-06-18 Thread Mohan.Radhakrishnan
Hi Dennis, I have copied the 'r' group. Could you explain ? Why can't we compute CI and error bars using this data set ? The graph generated has equal-sized error bars and a 99% confidence band. Groups are not needed here. But the error bar and CI calculations could be

[R] Grouping in R

2015-06-18 Thread Shivi82
Hi All, I am working on a data where the total row count is 25+ and have approx. 20 variables. One of the var on which i need to summarize the data is Consignor i.e. seller name. Now the issue here is after deleting all the duplicate names i still have 55000 unique customer name and i am

Re: [R] Proc Mixed variance of random effects in R

2015-06-18 Thread Thierry Onkelinx
Dear Gram, A few things first: Please don't post in HTML, it mangles your text. R-sig-mixed model is a better list for questions on mixed models. Send further replies only to that list and not to r-help. You are probably not fitting the same model in R as the one in SAS. Please provide the

[R] R 3.2.1 liftoff

2015-06-18 Thread Peter Dalgaard
The build system sent R-3.2.1.tar.gz (codename World-Famous Astronaut) in orbit this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.2.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to you.

Re: [R] Cross tabulation with top one variable and side as multiple variables

2015-06-18 Thread jagadishpchary
I think my explanation in the post is not giving the full details on the job to be done. Sorry for that. Here is what I am doing.. 1. I have a SPSS data set with more than 2000 variables. However for test purpose I have created a temporary data set with 5 variables which I am reading it to R

[R] Correlation matrix for pearson correlation (r,p,BH(FDR))

2015-06-18 Thread Sarah Bazzocco
This post was called help before, I changed the Subject. Thanks for the comments. Here the example: (I have the two lists saved as .csv and I can open them in R) Sheet one- Genes (10 genes expression, not binary, meaured in 10 cell lines) genes Genes Cell.line1 Cell.line2 Cell.line3

[R] Completing Unordered Categorical missing variables using package mi

2015-06-18 Thread IOANNA IOANNOU
Hello all, A perhaps simple question. I am trying to complete unordered categorical missing data using mi package. There are two variables with missing data: Mat and Use. The problem is that the Use has several categories and somehow this means I can't plot the results as I get this error.