Displaying 5 results from an estimated 5 matches for "all_combine1".
Did you mean:
all_combines
2016 Apr 17
2
R [coding : do not run for every row ]
...th one row of the sample_sizes matrix
##(use expand.grid)to create a data frame from combination of data
ss_sd1<- expand.grid(sample_sizes[2,],shp)
scp1<-rep(scp1,9)
std2<-rep(sd2,9)
#create a matrix combining the forty five cases of combination of sample sizes,shape and scale parameter
all_combine1 <- cbind(rep(sample_sizes[1,], 5),ss_sd1,scp1)
# name the column samples 1 and 2 and standard deviation
colnames(all_combine1) <- c("m", "n","sp(skewness1.5)","scp1")
##for the samples sizes into matrix then use a loop for sample sizes
# this loop st...
2016 Apr 18
0
R [coding : do not run for every row ]
...##(use expand.grid)to create a data frame from combination of data
>
> ss_sd1<- expand.grid(sample_sizes[2,],shp)
> scp1<-rep(scp1,9)
>
> std2<-rep(sd2,9)
>
> #create a matrix combining the forty five cases of combination of sample sizes,shape and scale parameter
> all_combine1 <- cbind(rep(sample_sizes[1,], 5),ss_sd1,scp1)
>
> # name the column samples 1 and 2 and standard deviation
> colnames(all_combine1) <- c("m", "n","sp(skewness1.5)","scp1")
>
> ##for the samples sizes into matrix then use a loop for sampl...
2016 Apr 18
3
R [coding : do not run for every row ]
...##(use expand.grid)to create a data frame from combination of data
>
> ss_sd1<- expand.grid(sample_sizes[2,],shp)
> scp1<-rep(scp1,9)
>
> std2<-rep(sd2,9)
>
> #create a matrix combining the forty five cases of combination of sample sizes,shape and scale parameter
> all_combine1 <- cbind(rep(sample_sizes[1,], 5),ss_sd1,scp1)
>
> # name the column samples 1 and 2 and standard deviation
> colnames(all_combine1) <- c("m", "n","sp(skewness1.5)","scp1")
>
> ##for the samples sizes into matrix then use a loop for sampl...
2016 Apr 18
0
R [coding : do not run for every row ]
...From: Thierry Onkelinx <thierry.onkelinx at inbo.be>
> Sent: Monday, April 18, 2016 7:21 AM
> To: tan sj
> Cc: r-help
> Subject: Re: [R] R [coding : do not run for every row ]
>
> You can make this much more readable with apply functions.
>
> result <- apply(
> all_combine1,
> 1,
> function(x){
> p.value <- sapply(
> seq_len(nSims),
> function(sim){
> gamma1 <- rgamma(x["m"], x["sp(skewness1.5)"], x["scp1"])
> gamma2 <- rgamma(x["n"], x["scp1"], 1)
>...
2016 Apr 18
0
R [coding : do not run for every row ]
You can make this much more readable with apply functions.
result <- apply(
all_combine1,
1,
function(x){
p.value <- sapply(
seq_len(nSims),
function(sim){
gamma1 <- rgamma(x["m"], x["sp(skewness1.5)"], x["scp1"])
gamma2 <- rgamma(x["n"], x["scp1"], 1)
gamma1 <- gamma1 - x["sp...