search for: al1

Displaying 11 results from an estimated 11 matches for "al1".

Did you mean: al
2010 Nov 29
2
FW: how to use by() ?
Thank you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested: Al1 = c('A','C','C','C') Al2 = c('G','G','G','T') Freq1 = c(0.0078,0.0567,0.9434,0.9908) MAF = c(0.0078,0.0567,0.0566,0.0092) m1 = data.frame(Al1=Al1, Al2=Al2,Freq1=Freq1,MAF=MAF,major_allele='') m1 Al1 Al2 Freq1 MAF major_a...
2010 Nov 29
3
how to use by() ?
Hello, All! How might one accomplish this using the by() function? m1 is a data frame. # populate column "m1$major_allele" for ( i in 1:length(m1$major_allele)) { if ( m1$Freq1[i] == m1$MAF[i]){ m1$major_allele[i] = m1$Al1[i] } else{ m1$major_allele[i] = m1$Al2[i] } } Jim [[alternative HTML version deleted]]
2013 Apr 11
2
group data
Hey, I have a dataset and I want to identify the records by groups for further use in ggplot. Here is a sample data: ID Value AL1 1 AL2 2 CA1 3 CA4 4 I want to identify all the records that in the same state (AL1 AND A2), group them as "AL", and do the same for CA1 and CA4. How can I have an output like: ID Value State AL1 1 AL AL2 2 AL CA1 3 CA CA4 4 CA Thanks for your help! [[alte...
2009 Sep 18
1
Incorrect Dimension
...this script above i get the message "Error in gen[j, i] : incorrect number of dimensions". However gen is 1000x200 (ind x loc) and so is g could anybody help me for (i in 1 : loc) { #loc=200 for (j in 1 : ind) { #ind=1000 g1 <= function ( gen ) matrix ( if (gen[j, i] == 0) al1 [i, 1] + al1 [i, 1] else if (gen [j, i] == 1) al1 [i, 1] + al2 [i, 1] else if (gen [j, i] == 2) al2 [i, 1] + al2 [i, 1] else 999, ncol = loc, nrow = ind) g2 <= function ( gen ) sample (b1, 1, re = T) #b1 is 1x3 and came from a vector 1000X1 (e.g b1 <- c(x [1000,1]...) xx <=...
2009 Sep 17
3
How to separate a function by 2 probabilities
Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]<-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix) with probability P-1 That?s it, if P is .7, i would like that in 70% of the times (for random i and j) the matrix g was generated according...
2008 Mar 07
3
Combine two columns
Is there a way to combine two columns within a data frame? Example data: id snp AL1 AL2 1500 30 A B 1510 30 A A 1520 30 A B This is what I would like: indv snp AL1AL2 1500 30 AB 1510 30 AA 1520 30 AB Any help is greatly appreciated. Alysta
2010 Dec 09
4
lapply getting names of the list
Hello All, I have a toy dataframe like this. It has 8 columns separated by tab. Name SampleID Al1 Al2 X Y R Th rs191191 A1 A B 0.999 0.09 0.78 0.090 abc928291 A1 B J 0.3838 0.3839 0.028 0.888 abcnab A1 H K 0.3939 0.939 0.3939 0.77 rx82922 B1 J K 0.3838 0.393 0.393 0.0...
2006 Mar 25
1
Trouble phrasing an R command that will run the model i need (ANOVA, nes
...te with respect to each factor. Just in the interests of clarifying things as much as possible: one of my datasets looks like this(apologies if the formatting gets weird): foresttype region crosstype experiment linelabel yproductivity l g wx 1 al1 63 l g wx 1 al2 26 ... and so on. Each horizontal line refers to a single observation. The first horizontal line, for example, refers to a single cross that was found to have a yproductivity value of "63", and...
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
...eetings: I would like comments on this example and after fixing it up, I need help from someone who has access to insert this in R's help page for plotmath. I uploaded a drawing http://pj.freefaculty.org/R/Normal-2009.pdf that is created by the following code http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R This will be a good addition to the plotmath help page/example. Here's why: plotmath can be somewhat challenging. A few more concrete examples of ways in which users can combine values from R programs with plotmath expressions will be helpful to new users. In partic...
2010 Mar 09
3
Shade area under curve
I want to shade the area under the curve of the standard normal density. Specifically color to the left of -2 and on. How might i go about doing this? Thanks -- View this message in context: http://n4.nabble.com/Shade-area-under-curve-tp1586439p1586439.html Sent from the R help mailing list archive at Nabble.com.
2005 Sep 30
0
p-value for non-linear variable in overdispersed glm()
...optim() by first minimising glm(resp~ var1 + var2, family=binomial, data=data)$deviance where var1= exp(-a1*dist1), and var2= exp(-a2*dist2), where a1 and a2 are parameters and dist1 and dist2 are independent variables. Next, I calculate the value of var1 (and var2) by plugging in the value of al1 (and al2) that minimises deviance, and fit glm(resp~ var1+var2 , family=binomial, data=data) Var1 in this model thus includes two parameters - the standard glm() coefficient and a1. This is (of course) not recognized by drop1(). Usually I extract a rough p-value for var1 in this model by 1-pchis...