search for: sd2

Displaying 20 results from an estimated 79 matches for "sd2".

Did you mean: sd
2004 Nov 11
5
expressions and paste
I have written a function to plot data which will be used for various different chemistries. A simplified version is: plot_data <- function(risk,levels,chem,sd2,measure){ plot(risk, levels,main=paste ("per", sd2, measure, "\n in usual", chem)) } The problem is with the title. This works fine if the variable "chem" is just text, but if it is an expression then obviously it won't work. I have experimented with various thin...
2014 Feb 27
1
Join Samba4 member server to Windows AD
...servers in these domains, but up to now I have trouble adding Samba 4 member servers to Windows AD. My test environment is made of 2 Networks, which are connected through a VPN site2site tunnel. On one of this Networks I have the root domain (RD.LAN) with its DC rddc1.rd.and and a subdomain 2 (SD2.RD.LAN) with its DC sd2dc.sd2.rd.lan On the other network I have the subdomain 1 (SD1.RD.LAN) with its DC sd1dc1.sd1.rd.lan. I try the following steps on mserver1.sd1.rd.lan: first I install these required packages, as written in wiki.samba.org: build-essential libacl1-dev libattr1-dev libblki...
2013 Feb 01
2
How does this function print, why is n1 which equals 1 printed as 2?
...questions, (i) how is the function printing when there is no code to print and (ii) how is n1 which equals 1 being reported as 2? I suspect there is something fundamental about R that I don't know. Thank you for the help. John library(epicalc) n.for.2means.js <- function (mu1, mu2, sd1, sd2, ratio = 1, alpha = 0.05, power = 0.8) { n1 <- (sd1^2 + sd2^2/ratio) * (qnorm(1 - alpha/2) - qnorm(1 - power))^2/(mu1 - mu2)^2 n1 <- round(n1) n2 <- ratio * n1 if (length(alpha) == 1) { alpha1 <- NULL } else { alpha1 <- alpha } if (length(power) == 1) {...
2008 Feb 15
1
Questions about EM algorithm
Dear all: Assume I have 3 distributions, x1, x2, and x3. x1 ~ normal(mu1, sd1) x2 ~ normal(mu2, sd2) x3 ~ normal(mu3, sd3) y1 = x1 + x2 y2 = x1 + x3 Now that the data I can observed is only y1 and y2. It is easy to estimate (mu1+m2), (mu1+mu3), (sd1^2+sd2^2) and (sd1^2+sd3^2) by EM algorithm since y1 ~ normal(mu1+mu2, sqrt(sd1^2+sd2^2)) and y2 ~ normal(mu1+mu3, sqrt(sd1^2+sd3^2)) However, I wan...
2011 Jan 10
2
Calculating Portfolio Standard deviation
...            DEF = c(22,28,20,20,28,26,29,18,24,21),                                           GHI = c(32,27,32,36,37,37,34,23,25,32),                                           JKL = c(47,60,60,43,62,38,44,53,61,41)) sd_prices <- c(3.3483,3.9497,4.9721,9.3387)   # standard deviations say(sd1, sd2, sd3, sd4)                         weights <- c(0.10, 0.25, 0.20, 0.45)      # say (w1, w2, w3, w4) I need to calculate the standard deviation of the portfolio. The formula is stdev_portfolio = sqrt((w1*sd1)^2+(w2*sd2)^2+(w3*sd3)^2+(w4*sd4)^2 +                         2*w1*w2*sd1*sd2*correlat...
2010 May 18
25
Very serious performance degradation
Hi, I''m running Opensolaris 2009.06, and I''m facing a serious performance loss with ZFS ! It''s a raidz1 pool, made of 4 x 1TB SATA disks : zfs_raid ONLINE 0 0 0 raidz1 ONLINE 0 0 0 c7t2d0 ONLINE 0 0 0 c7t3d0 ONLINE 0 0 0 c7t4d0 ONLINE 0 0
2006 Feb 24
1
Read SAS .sd2 file into R?
Does anyone know how to import a SAS .sd2 file into R? I can't see anything in library(foreign). Thank you. Mark
2007 Sep 27
1
Reading SAS SD2 Data file
I am trying to read a SAS dataset into R that is in a .SD2 format, which is the Version 6 standard format from SAS. I see the routines that read the SAS XPORT format (foreign, Hmisc), but is there any way to read this one? Any help would be greatly appreciated. Corey Sparks Corey Sparks Assistant Professor Department of Demography and Organization Studies...
2013 Jan 30
2
Integration of mixed normal distribution
Hi, I already found a conversation on the integration of a normal distribution and two suggested solutions (https://stat.ethz.ch/pipermail/r-help/2007-January/124008.html): 1) integrate(dnorm, 0,1, mean = 0, sd = 1.2) and 2) pnorm(1, mean = 0, sd = 1.2) - pnorm(0, mean = 0, sd = 1.2) where the pnorm-approach is supposed to be faster and with higher precision. I want to integrate a mixed
2009 May 22
0
EM algorithm mixture of multivariate
...tterplot3d(y[,1], y[,2], p , highlight.3d=TRUE, col.axis="blue", col.grid="lightblue",main="val iniz mistura normali multivariata", angle=120, pch=20) #verosimiglianza iniziale l0<-sum(log(p)) l1<-l0 alpha<-alpha0 mu1<-mu01 mu2<-mu02 sd1<-sd01 sd2<-sd02 for (iter in 1:itermax) { #passo E for (i in 1:n) { tau[i,1]<-(alpha*f1[i])/p[i] tau[i,2]<-((1-alpha)*f2[i])/p[i] } #passo M alpha= mean(tau[,1]) mu1=colSums(tau[,1]*y)/sum(tau[,1]) mu2=colSums(tau[,2]*y)/sum(tau[,2]) ycen1<-(y-mu1) ycen2<-(y-mu2) cov1<-matrix(0,2,2...
2009 May 22
0
EM algorithm mixture of multivariate gaussian
...tterplot3d(y[,1], y[,2], p , highlight.3d=TRUE, col.axis="blue", col.grid="lightblue",main="val iniz mistura normali multivariata", angle=120, pch=20) #verosimiglianza iniziale l0<-sum(log(p)) l1<-l0 alpha<-alpha0 mu1<-mu01 mu2<-mu02 sd1<-sd01 sd2<-sd02 for (iter in 1:itermax) { #passo E for (i in 1:n) { tau[i,1]<-(alpha*f1[i])/p[i] tau[i,2]<-((1-alpha)*f2[i])/p[i] } #passo M alpha= mean(tau[,1]) mu1=colSums(tau[,1]*y)/sum(tau[,1]) mu2=colSums(tau[,2]*y)/sum(tau[,2]) ycen1<-(y-mu1) ycen2<-(y-mu2) cov1<-matrix(0,2,2...
2004 Sep 16
3
Estimating parameters for a bimodal distribution
...series of datasets that have a bimodal distribution. I have used the following functions, in particular the ms() function, to estimate the parameters: two means, two standard deviations, and one proportion. Here is the code I've been using in S: btmp.bi <- function(vec, p, m1, m2, sd1, sd2) { (exp(p)/(1+exp(p)))*dnorm(vec,mean=m1,sd=abs(sd1))+ (1-(exp(p)/(1+exp(p))))*dnorm(vec,mean=m2,sd=abs(sd2)) } btmp11 <- ms( ~ - sum(log((btmp.bi(btmp1$Temp, p, m1, m2, s1, s2)))), start = list(p = 0.4, m1 = 38, m2 = 40, s1 = 1, s2 = 1)...
2005 Jan 08
2
Does R accumulate memory
...oefficient[2]) int2 <- lapply(glsrun2, function(x) x$coefficient[1]) slo2 <- lapply(glsrun2, function(x) x$coefficient[2]) # Step 6 Compute SD of intercepts and slopes int.sd1 <- sapply(glsrun1, function(x) x$coefficient[1]) slo.sd1 <- sapply(glsrun1, function(x) x$coefficient[2]) int.sd2 <- sapply(glsrun2, function(x) x$coefficient[1]) slo.sd2 <- sapply(glsrun2, function(x) x$coefficient[2]) cat("Original Standard Errors","\n", "Intercept","\t", sd(int.sd1),"\n","Slope","\t","\t", sd(slo.sd1),&qu...
2017 Jun 04
0
Hlep in analysis in RWinBugs
...)*S2*m2 a31[i]<-sm[i]*S1*(1-m1)*S2*(1-m2)*S3 sum[i]<-a11[i]+a21[i]+a31[i] } #priors #priors are dbeta(0.5,0.5), uniform is dbeta(1,1) S1~dbeta(1,1)#I(0,0.2) # S2~dbeta(1,1)#I(0.15,0.5) # S3~dbeta(1,1)#I(0.3,1) m1~dbeta(1,1)#I(0.01,1) m2~dbeta(1,1)#I(0,1) sd ~ dunif(0,100) sd1 ~ dunif(0,100) sd2 ~ dunif(0,100) tau <- 1/(sd*sd) tau1 <- 1/(sd1*sd1) tau2 <- 1/(sd2*sd2) } model.file <- Model file.show(model.file) #The Data list(N = 4, sm=c(9309,3253,5292,1361), a1=c(16,3,4,2), a2=c(96,31,42,3), a3=c(47,5,18,1)) inits <- function(){ list(sd = 1000, sd1 = 1000, sd2 = 1000, S1 = 0...
2017 Jun 04
0
Help in analysis in RWinBugs
...)*S2*m2 a31[i]<-sm[i]*S1*(1-m1)*S2*(1-m2)*S3 sum[i]<-a11[i]+a21[i]+a31[i] } #priors #priors are dbeta(0.5,0.5), uniform is dbeta(1,1) S1~dbeta(1,1)#I(0,0.2) # S2~dbeta(1,1)#I(0.15,0.5) # S3~dbeta(1,1)#I(0.3,1) m1~dbeta(1,1)#I(0.01,1) m2~dbeta(1,1)#I(0,1) sd ~ dunif(0,100) sd1 ~ dunif(0,100) sd2 ~ dunif(0,100) tau <- 1/(sd*sd) tau1 <- 1/(sd1*sd1) tau2 <- 1/(sd2*sd2) } model.file <- Model file.show(model.file) #The Data list(N = 4, sm=c(9309,3253,5292,1361), a1=c(16,3,4,2), a2=c(96,31,42,3), a3=c(47,5,18,1)) inits <- function(){ list(sd = 1000, sd1 = 1000, sd2 = 1000, S1 = 0...
2010 Nov 23
1
Barplot and plot means with confidence intervals in the same plot
...n example of my data: mean1<-cbind(55.5,56.42,56.38,55.28) SD1<-cbind(10,9 ,7 ,3) x<-rbind(mean1,SD1) colnames(x)<-c("Autumn","Spring","Summer","Winter") rownames(x)<-c("MeanProts","SD") mean2<-cbind(10,15,9,8) SD2<-cbind(2,3 ,1 ,5) y<-rbind(mean2,SD2) colnames(y)<-c("Autumn","Spring","Summer","Winter") rownames(y)<-c("MeanDNA","SD") Thanks in advance. Nacho -- Ignacio Alborés Blanes Grupo de Investigación en Recursos Marinos...
2013 Jan 13
1
How to combine two loops?
...have 2 groups and for each group I need to compute the following steps; i) Generate 3 random numbers from normal distribution and square them. ii) Repeat step 1 for 15 times and at the end I will get 15 random numbers. I already done stage I using for loop. n1<-3 n2<-3 miu<-0 sd1<-1 sd2<-1 asim<-15 w<-rep(NA,asim) x<-rep(NA,asim) for (i in 1:asim) { print(i) set.seed(i) data1<-rnorm(n1,miu,sd1) data2<-rnorm(n2,miu,sd2) w[i]<-sum(data1^2) x[i]<-sum(data2^2) } w x Second stage is; Stage II For each group, I need to: i) Sort the group; ii) Find trimmed mean...
2012 Jun 04
1
simulation of modified bartlett's test
...run this code to get the power of the test for modified bartlett's test..but I'm not really sure that my coding is right.. #normal distribution unequal variance asim<-5000 pv<-rep(NA,asim) for(i in 1:asim) {print(i) set.seed(i) n1<-20 n2<-20 n3<-20 mu<-0 sd1<-sqrt(25) sd2<-sqrt(50) sd3<-sqrt(100) g1<-rnorm(n1,mu,sd1) g2<-rnorm(n2,mu,sd2) g3<-rnorm(n3,mu,sd3) x=c(g1,g2,g3) group=c(rep(1,n1),rep(2,n2),rep(3,n3)) N=60 k=3 v1=var(g1) v2=var(g2) v3=var(g3) #pooled variance A=((n1-1)*v1+(n2-1)*v2+(n3-1)*v3)/(N-k) #calculate B B=((N-k)*(log(A)))-((n1-1)*log(...
2010 Jul 18
2
loop troubles
...us posterior to be the new prior and now I cant figure out how to do the code below in a loop. The data below is dummy data, I used a starting mu of 1, and starting precision of 0. bayes.analysis.treat<-function(mu0,p0){ n1 = 5 n2 = 10 n3 = 15 ybar1 = 12 ybar2 = 13 ybar3 = 14 sd1 = 2 sd2 = 3 sd3 = 4 #posterior 1 var1 = sd1^2 #sample variance p1 = n1/var1 #sample precision p1n = p0+p1 mu1 = ((p0)/(p1n)*mu0)+((p1)/(p1n))*ybar1 sigma1 = 1/sqrt(p1n) #posterior 2 var2 = sd2^2 #sample variance p2 = n2/var2 #sample precision p2n = p1n+p2 mu2 = ((p1n)/(p2n)*mu1)+((p2)/(p2n))*yb...
2002 Apr 26
4
SAS and R
Hello I am sure this is elementary, but I can't figure it out..... I am using SAS v8.2 and R 1.4.1 on a Windows platform. I have a large (6 megabyte) file in .sd2 format. I want to import it into R. If necessary, I can create a smaller file, as I don't need all the variables that are in this file I downloaded the package foreign. I then tried to use PROC CPORT in SAS to create a transport file. It gave no error message, but I cannot find the file it...