Displaying 20 results from an estimated 500 matches similar to: "reshape"
2012 Oct 15
1
library(rmeta)
Hello,
I have a data with following format:
Predictors n11 n12 n21 n22 Odds.Ratio log.ratio se.log.odds.
1 ProcOR respirato
2 ProcVaric vein
3 DiagCardiac anom
4 DiagAllergy
5 DiagOth skin dx
6 DiagGastritis
I want to plot odds ratio by command: forestplot in rmeta library, but I get the following error constantly.
Error in
2012 Nov 13
4
for loop
HI,
You can do this in many ways:
dat1<-read.table(text="
med1,med2,med3????
?1,0,1??????
0,1,1???
2,0,0
",sep=",",header=TRUE)??
#1st method
library(reshape)
dat2<-melt(dat1)
dat3<-aggregate(dat2$value,by=list(dat2$variable),sum)
?colnames(dat3)<-c("name","sum(n11)")
?dat3
#? name sum(n11)
#1 med1??????? 3
#2 med2??????? 1
#3 med3??????? 2
2009 Oct 16
1
How odds ratio is computed in fisher.test()?
I'm wondering how odds ratio is computed. I thought that it is
(n11/n12)/(n21/n22), but it is not what fisher.test() computes. Could
somebody let me know?
> n11=3
> n12=1
> n21=1
> n22=3
>
> n1_=n11+n12
> n2_=n21+n22
>
> n_1=n11+n21
> n_2=n12+n22
>
> x=rbind(c(n11,n12),c(n21,n22))
>
> threshold=dhyper(n11,n1_,n2_,n_1)
>
2012 Oct 23
3
frequency
Hello,
I have a data as follow:
ID Visit
xa1
xa2
yb1
yc23
yb33
I want to look at frequency of visit for ID and create a new column as response .
For example my response would be 2 for x and 3 for y.
I think I need to write a loop, but I don't know how.
I really appreciate your help.
Thanks a lot.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
2006 Jun 05
3
Fastest way to do HWE.exact test on 100K SNP data?
Hi everyone,
I'm using the function 'HWE.exact' of 'genetics' package to compute p-values of
the HWE test. My data set consists of ~600 subjects (cases and controls) typed
at ~ 10K SNP markers; the test is applied separately to cases and controls. The
genotypes are stored in a list of 'genotype' objects, all.geno, and p-values are
calculated inside the loop over all
2013 Jan 28
2
Pivot
Hi,
I have a data set as follow:
X Z
x1 102
x2 102
x2 102
x2 77
x3 23
I need to pivot this data as follows and assign the values based on frequency of column Z:
X Z.102 Z.77 Z.23
x1 1 0 0
x2 21 0
x3 00 1
Thanks.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
2017 Jun 28
4
Different date formats in one column
Hi,?
I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats:
02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014
I tried parse_date_time from lubridate library but it failed.Thanks so much.?Best,Farnoosh
[[alternative HTML version deleted]]
2012 Oct 08
2
converting DOB format to age
Hi,
I have a column of DOB in mm/dd/yyyy. I want to convert this format to age.
Thanks a lot.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
2018 Apr 18
3
Identifying columns with specific character
Hello,
I have a data frame with 400 columns and wanted to filter character columns with "$" in it.For example:?>? x <- c("$5", "$89", "$10", "$34")??>? y <- c(1:4)>? My.Data <- data.frame (x,y)> My.Data? ? x y1? $5 12 $89 23 $10 34 $34 4
I want to detect the columns with $ and remove the $ from the selected columns.I have
2012 Dec 12
1
Subset of Data
Hi Arun,
I have a question about choosing a subset of data.
I have a matrix of 5000 in 3500.
I want to choose specific variables such as proc1 to proc1000 and Lab1 to Lab1600 and put it into a new matrix to run some correlation analysis.
Since I have 3500 variables, I don't know from what column my lab or procedures start.
I really appreciate your help.
Thanks.
Best,Farnoosh Sheikhi
2017 Jun 29
0
Different date formats in one column
I doubt your actual file looks like the mess that made it to my email
software (below) because you posted HTML-format email. Read the Posting
Guide, and in particular figure out how to send plain text email.
You might try the "anytime" contributed package, though I suspect it too
will choke on your mess. Otherwise, that will pretty much leave only a
brute-force series of regular
2016 Mar 29
2
Filtering based on the occurrence
Hello,?
I have a data set similar to below and I wanted to keep the observations after the first occurrence of these department: "B", "D", "F".For example for ID=2, the observation with deps=B and anything after will be kept in the data. For ID=3, observations with deps=D and anything after will be included.
Subject<- c("2", "2", "2",
2013 Aug 26
1
Loop for converting character columns to Numeric
Hi,
Suppose you created a dataframe like this:
set.seed(28)
?dat1<-as.data.frame(simplify2array(list(letters[1:5],sample(1:20,5,replace=TRUE),6:10)),stringsAsFactors=FALSE)
?str(dat1)
#'data.frame':??? 5 obs. of? 3 variables:
# $ V1: chr? "a" "b" "c" "d" ...
# $ V2: chr? "1" "2" "10" "18" ...
# $ V3: chr?
2012 Nov 15
1
Step-wise method for large dimension
Hi ,
I want to apply the following code fo my data with 400 predictors.
I was wondering if there ia an alternative way instead of typing 400 predictors for the following code.
I really appreciate your help.
fit0<-lm(Y~1, data= mydata)
fit.final<- lm(Y~X1+X2+X3+.....+X400, data=mydata) ???
step(fit0, scope=list(lower=fit0, upper=fit.final), data=mydata, direction="forward")
2012 Nov 06
1
pivot table
Hello,
I have a data which looks like below: Some of the patients have multiple diagnosis.
ID(200 patients) Diag (100 unique Diag-200 in general) Proc (50 uniqe Proc) DOB (200) Gender (200)
a daig1
b diag2
c diag1
I want to reformat this data to :
ID diag1 diag 2 diag 3.. diagx proc1 proc2
2017 Jun 29
1
Different date formats in one column
Thanks Jeff. This is a nice way of solving this problem. What about the cases with 0015-02-21?Many thanks.?Best,Farnoosh
On Wednesday, June 28, 2017 10:49 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:
I doubt your actual file looks like the mess that made it to my email
software (below) because you posted HTML-format email. Read the Posting
Guide, and in particular
2013 Apr 13
2
Comparison of Date format
Hi,
?In the example you provided, it looks like the dates in Date2 happens first.? So, I changed it a bit.?
DataA<- read.table(text="
ID,Status,Date1,Date2 ??? ??? ??????
1,A,3-Feb-01,15-May-01 ??? ???
1,B,15-May-01,16-May-01 ??? ???
1,A,16-May-01,3-Sep-01 ??? ??? ??? ??? ???
1,B,3-Sep-01,13-Sep-01 ??? ??? ??? ??? ???
1,C,13-Sep-01,26-Feb-04 ??? ??? ??? ??? ???
2017 Jun 29
0
Different date formats in one column
Hey,
Are all the dates connected? So no comma or space btw?
Regards,
Christoph
> On 29 Jun 2017, at 2:02 pm, Farnoosh Sheikhi via R-help <r-help at r-project.org> wrote:
>
> Hi,
> I have a data set with various date formats in one column and not sure how to unify it.Here is a few formats:
> 02091702/22/170221201703/17/160015-08-239/2/1500170806May-2-201522-March-2014
2004 Apr 19
11
Size of R user base
I have been trying to determine the size of the R user base, and was
asked to share my findings with this mailing list. Although I still
don't have any definite estimate of this number, I do have some
interesting and indicative information:
1. It appears that there are about 100,000 S-PLUS users.
Rationale: According to Insightful's 2002 Annual Report, over 100,000
people use
2018 Apr 18
0
Identifying columns with specific character
Hi Farnoosh,
Perhaps this will help:
drop_dollar<-function(x) return(as.numeric(as.character(gsub("\\$","",x))))
sapply(My.Data,drop_dollar)
Jim
On Thu, Apr 19, 2018 at 7:23 AM, Farnoosh Sheikhi via R-help
<r-help at r-project.org> wrote:
> Hello,
> I have a data frame with 400 columns and wanted to filter character columns with "$" in it.For