Displaying 13 results from an estimated 13 matches for "samp2".
Did you mean:
samp
2018 Mar 15
3
stats 'dist' euclidean distance calculation
...the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated:
3x3 subset used
Locus1 Locus2 Locus3
Samp1 GG <NA> GG
Samp2 AG CA GA
Samp3 AG CA GG
The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2))
My assumption was that the difference between x_i and y_i would be the number of allelic differences at each base pair site...
2010 May 23
2
Subsetting with a list of vectors
....
. . .
. . .
I want to select rows belonging to 7 random plots for 100 times.
(There are 50 plots in total)
So I created a list of 100 vectors, each vector has 7 elements.
samp <- lapply(1:100, function(i) sample(LETTERS))
samp2 <- lapply(samp2, "[", 1:7)
How can I select the 26 plots from 'data' using 'samp'?
samp3 <- sample(LETTERS, 7)
samp4 <- subset(data, plot %in% samp3) # this works
samp5 <- subset(data, plot %in% samp2[[1]]) # this works as well, but
I used a for loop to get i...
2008 Mar 15
2
Please find the error in my code
...e t test vs various
#### non-parametric alternatives
sim.size <- 200
sample.size <- 10
set.seed(231)
mu1 <- 0
delta <- seq(-2,2, length=50)
for (j in 1:length(delta))
{
mu2 <- mu1 + delta[j]
for (i in 1:sim.size)
{
# Generate ith sample
samp1 <- rnorm(mean=mu1,sample.size)
samp2 <- rnorm(mean=mu2,sample.size)
# Perform ith set of tests
test1 <- t.test(samp1, samp2,alternative = c("two.sided"))
pt.test[i] <- (test1$p.value < 0.05)
test2 <- wilcox.test(samp1, samp2,alternative = c("two.sided"),
exact = TRUE)...
2011 Jun 21
2
interaction between categorical variables
...-levels also converted to dummy variables). So I have worked with them in two ways:
i created a variable X1 = dgen*dtoe and I get an error "Error in dgen * dtoe : non-conformable arrays"then i run a glm, binomial using that interaction variable and i get : logit_x = glm(samp2$STATUS ~ dgen*dtoe, data=samp2,family = binomial("logit"))
> summary(logit_x)
Call:
glm(formula = samp2$STATUS ~ dgen * dtoe, family = binomial("logit"),
data = samp2)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.6594 0.2431 0.2563 0.2563...
2004 Feb 12
1
How do you create a "MCMC" object?
...sults of each iteration for 86 variables. I run 10,000 iterations. So, the
matrix samp is 10,000 x 86. I want to use the gelman-rubin test to check for
convergence. To do that, I need at least two chains. If I run second chain
with different starting values and seed, I could save to the matrix 'samp2'.
So, I will have two matrices 10,000x86. I want to use the function
gelman.diag(x, confidence = 0.95, transform=FALSE), where x: An 'mcmc.list'
object with more than one chain, and with starting values that are
overdispersed with respect to the posterior distribution. How do I create
m...
2006 Nov 09
1
dissimilarity matrices
Dear All,
I have a dissimilarity matrix which I happily convert to a distance object
by running:
X <- as.dist(Y)
and I can happily now run either hclust(X) or agnes(X).
So that the various bits of output are labelled correctly I would dearly
like to be able to give names to the columns and rows of X, as would happen
if I ran:
mydata<-read.table("clipboard",header=T)
2018 Mar 15
0
stats 'dist' euclidean distance calculation
> 3x3 subset used
> Locus1 Locus2 Locus3
> Samp1 GG <NA> GG
> Samp2 AG CA GA
> Samp3 AG CA GG
>
> The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2)) My
> assumption was that the difference between x_i and y_i would be the number
> of allelic difference...
2009 Oct 14
2
Getting indeices of intersecting elements.
Hi,
Is there a command to get the indices of intersecting elements of two
vectors as intersect() will give the elements and not its indices.
Thanks in advance.
Praveen Surendran
School of Medicine and Medical Sciences
University College Dublin
Belfield, Dublin 4
Ireland.
[[alternative HTML version deleted]]
2010 Jul 06
2
Help With ANOVA
...7, 1.846162, -4.60517, 2.121427, 1.973118,
-4.60517, 2.251568, -4.60517, 2.270724, 0.70338, 0.963816, -4.60517, 0.023703, -4.60517,
2.043382, 1.070586, 2.768289, 1.085169, 0.959334, -0.02428, -4.60517, 1.371895, 1.533227)
"zzzanova" <-
structure(list(Intensity = c(t(Samp1), t(Samp2), t(Samp3), t(Samp4)),
Group = structure(c(1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6), .Label = c("Group1", "Group2", "Group3", "Group4", &quo...
2011 May 05
0
Conditional distribution plot using Model-based Recursive Partitioning
...e to estimate the relationship between the
probability of being a student and number of siblings (alive). However, I
need to include a number of relevant covariates. My code is below:
fm3 <- mob(Student ~ age + alive + sex2 + cwa + cha + cym | Religion+Servant
+ Literacy, control = ctrl, data = samp2, model = glinearModel, family
=binomial())
plot(fm3, tp_args = list(which = "alive"),tnex = 2, type = "simple" )
Which works fine. However, the plots generated do not show the conditional
relationship between the dependent and independent variable at each node.
Basically, there...
2010 Mar 09
3
Help with ANOVA in R
...e this method (aov) assumes equal variances. How can I adjust this to do an ANOVA with unequal variances
#####SCRIPT STARTS
#Creates a structured list suitable for ANOVA analysis
# Intensity Group (1,2,3,4) Sample(1:62)
"zzzanova" <-
structure(list(Intensity = c(t(Samp1), t(Samp2), t(Samp3), t(Samp4)),
Group = structure(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4), .Label = c("Group1", "Group2", "Group3", "Group4"), class =...
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
2004 Feb 17
0
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
...h iteration for 86 variables. I run 10,000 iterations. So,
the
>matrix samp is 10,000 x 86. I want to use the gelman-rubin test to check
for
>convergence. To do that, I need at least two chains. If I run second chain
>with different starting values and seed, I could save to the matrix
'samp2'.
>So, I will have two matrices 10,000x86. I want to use the function
>gelman.diag(x, confidence = 0.95, transform=FALSE), where x: An 'mcmc.list'
>object with more than one chain, and with starting values that are
>overdispersed with respect to the posterior distribution. H...
2007 Nov 26
2
Filling in a Zero Matrix
Hi
I am very new to R and statistical programming in general. I am trying to reorder data from a .csv file. I have managed to import the data and create a zero matrix. I am now trying to fill the matrix. There seems to be some problem with this section of my code. I have highlighted the dodgy code in red. Please help if possible.
######################################################
###########