Displaying 15 results from an estimated 15 matches for "al2".
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_allele
1 A G 0.0078 0.0078
2 C G 0.056...
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]]
2009 Sep 18
1
Incorrect Dimension
...ct 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 <= if (runif (1) >= (1 - r2)) g1 else g2
g [j, i] <= xx (gen [j,...
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!
[[alternative...
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
2007 Jan 24
1
solving a structural equation model using sem or other package
...udinal Data Analysis. Oxford University Press, 2003" using R. I have the SAS code and S-Plus code from the UCLA site (doesn't include chapter 8 or later problems). In chapter 8, there is a structural equation/path model which can be specified for the sem package as follows
S <- cov(al2) #al2 contains the variables alc1, alc2, alc3, and cons
N <- 1122
modelA.ram <- specify.model()
f1 -> alc1, NA, 1
f1 -> alc2, NA, 1
f1 -> alc3, NA, 1
f2 -> alc1, NA, 0
f2 -> alc2, NA, .75
f2 -> alc3, NA, 1.75
cons -> f1, p0...
2012 May 25
1
Breakpoint in logistic GLM with 'segmented' package - error: replacement length zero
...riable with possible values between 0 and 1 - mine
runs from 0.05 to 0.5, increasing with steps of 0.05
s.size - a count variable - increases from 3 to 25 with steps of 1,
and from 25 to 60 with steps of 5
Each combination of s.size and bedekking has 100 repeats so the
resulting dataframe 'dat.al2' consists of 30000 observations of 3
variables.
Because the response variable has values between 0 and 1, I used a logistic GLM:
> gmodel <- glm(R.AUC ~ bedekking + s.size, data=dat.al2, family = quasibinomial(link=logit))
R.AUC increases with increasing s.size and decreasing bedekking...
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
...alX[1], specialX, specialX[length(specialX )]), c(0,
specialY, 0), density=c(-110),col="lightgray" )
shadedArea <- round(pnorm(mu - 1.96 * sigma, mean=mu, sd=sigma),4)
### I want to insert annotation about area on left side.
al1 <- bquote(Prob(x <= .(round(criticalValue,2))))
al2 <- bquote(phantom(0) == F( .(round(criticalValue,2)) ))
al3 <- bquote(phantom(0) == .(round(shadedArea,3)))
### Hard to position this text "just right"
### Have tried many ideas, this may be least bad.
### Get center position in shaded area
medX <- median(specialX)
### density a...
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.
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.00
rcn393...
2001 Mar 22
1
two easy questions...
...want to pass only some of them to a function, e.g.
glm(resp~from PC1 to PC10, PC15, etc.,...)
is there a faster way than simply writing each variable name in the formula?
2) Again, I have a dataframe, say ali.df, with tha following variables: ali1, ali2, ...ali78
I want to sum, for example, ali1+al2+ali7+f rom ali10 to ali20 etc., then from ali4 to ali8, etc. and then put everything in a new dataframe
I'd do somthing like:
new.df <- cbind(apply(ali.df[c(1:2,7,10:20)],1,sum), apply(ali.df[4:8],1,sum)) and so on.
Is it the right and only way?
Thanks in advance (and forgive my orrib...
2006 Mar 25
1
Trouble phrasing an R command that will run the model i need (ANOVA, nes
...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 that cross happened to be in the "l"
foresttype, the "g" re...
2005 Sep 30
0
p-value for non-linear variable in overdispersed glm()
...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-pchisq(scaled...
2014 Jan 28
3
[LLVMdev] New machine model questions
...don't know how much of a reduction I can expect at the moment.
I'm not sure I fully understand the super-resource suggestion. I've attached my WIP so you can take a look at the code in context but the relevant extracts are below.
def P5600IssueALU : ProcResource<1>;
def P5600IssueAL2 : ProcResource<1>;
def P5600ALQ : ProcResGroup<[P5600IssueALU]> { let BufferSize = 16; }
def P5600AGQ : ProcResGroup<[P5600IssueAL2, ...]> {
let BufferSize = 16;
}
def P5600WriteALU : SchedWriteRes<[P5600IssueALU]>;
def P5600WriteAL2 : SchedWriteRes<[P5600IssueAL2]>;...
2008 Aug 09
2
xy plot in version 2.7.1 for Mac (PR#12520)
...+pqo1/tBX0XCPFH0VST6KhJ9TfRN1PsiPcen1XWaqTyAT3WddvGEeORrY7YrUJ5uay/Rk3eC
y742+wBeSPZSAq4nLLjQsgJEXueX5ZcJE/aUMCWKu66Yyb52giv7ANsbM9mgTnaXk3fZ8o7lZPfP
r4z+OvBAtWy5WIoo9grdjz5w8ePaqrJjGVG1OmxmtVqK24tOkwnaxsoAdOMv6xIS/Ph4iSqHQzle
OEpSv6PQFQtdXFzM8T9zQR8T1IjOfrxoHOxivhy2jDoCkppTXcNxFNTMRhhw53EAr0viT6IjgAl2
4Iq743JrYh5eikqEKXdchmXLY1wsDstiVHcVVTouh+NyU14RJfp/cyrEIwplbmRzdHJlYW0KZW5k
b2JqCjM5IDAgb2JqCjUxMDgKZW5kb2JqCjQwIDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRv
ciAvQXNjZW50IDkwNSAvQ2FwSGVpZ2h0IDcyMyAvRGVzY2VudCAtMjEyIC9GbGFncyAzMgovRm9u
dEJCb3ggWy02NjUgLTMyNSAyMDI4IDEwMDZdIC9Gb250TmFtZSAvRFVWRUtVK0FyaWFs...