Re: [R] Testing for normality in categorical data

2019-10-05 Thread Jim Lemon
Hi Nancy, The chickwts dataset contains one sort-of continuous variable (weight) and a categorical variable (feed). Two things that will help you to understand what you are trying to do is to "eyeball" the "weight" data: # this shows you the rough distribution of chick weights hist(chickwts$weight

[R] Axiom alike formula needs to get prooved

2019-10-05 Thread Frank Schwidom
Hi, I found the following relationship: it is given x is a vector, bm1 and bm2 are vectors of type logical end exactly as long as x then the following formula returns alwasy TRUE: all( x[ bm1 & bm2] == x[ bm2][ bm1[ bm2]] ) . I think it is no such great deal and a lot of R programmers will k

Re: [R] how to select all columns that contain in any of their rows a partial match for a string?

2019-10-05 Thread Ana Marija
Thank you so much this worked wonderfully! On Sat, Oct 5, 2019 at 4:05 PM Rui Barradas wrote: > > Hello, > > Please CC the list. > > The following code does what you want. > > tot <- data.frame(a = c("E10123", "F123", "G4567"), >b = c("a123", "E112345", "b456")) > > e10 <- sap

Re: [R] how to select all columns that contain in any of their rows a partial match for a string?

2019-10-05 Thread Rui Barradas
Hello, Please CC the list. The following code does what you want. tot <- data.frame(a = c("E10123", "F123", "G4567"), b = c("a123", "E112345", "b456")) e10 <- sapply(tot, function(x) grepl("^E10", x)) e10 <- rowSums(e10) > 0 e11 <- sapply(tot, function(x) grepl("^E11", x)) e1

Re: [R] how to select all columns that contain in any of their rows a partial match for a string?

2019-10-05 Thread Rui Barradas
Hello, Try the following cols <- sapply(tot, function(x) any(grepl("^E94", x))) To have the column numbers, which(cols) Hope this helps, Rui Barradas Às 19:50 de 05/10/19, Ana Marija escreveu: Hello, I have a data frame tot which has many columns and many rows. I am trying to find all c

[R] how to select all columns that contain in any of their rows a partial match for a string?

2019-10-05 Thread Ana Marija
Hello, I have a data frame tot which has many columns and many rows. I am trying to find all columns that have say a value in any of their rows that STARTS WITH: "E94" for example there are columns like this: > unique(tot$diagnoses_icd9_f41271_0_44) [1] NA "E9420" I tried: s=select(tot,st

Re: [R] Testing for normality in categorical data

2019-10-05 Thread Bert Gunter
Categorical data cannot be normal. What you are doing is statistical nonsense, as your error messages suggest. You need to consult a local statistician for help. Furthermore, statistical questions are generally OT on this list, which is about R programming. Bert Gunter "The trouble with having

[R] Testing for normality in categorical data

2019-10-05 Thread Nancy Felix
Hello I have data that are categorical both independent variable and dependent as well having levels more than 3. How can i check the normality of my data? I have tried the example given of Shapiro-Wilk for levels of factors data summary(chickwts) ## linear model and ANOVA fm <- lm(weight ~ feed