R

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

R version 3.6.

0 (2019-04-26) -- "Planting of a Tree"


Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"


Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> x<-seq(0,100,by=1) > y<-dweibull(x,shape = 2.5,scale=1) > plot(x,y,main=' función


de densidad Weibull',col='blue')
Error in dweibull(x, shape = 2.5, scale = 1) : object 'x' not found
> x<-seq(0,100,by=1) > y<-dweibull(x,shape = 2.5,scale=1) > plot(x,y,main=' función
de densidad Weibull',col='blue')
Error in dweibull(x, shape = 2.5, scale = 1) : object 'x' not found
> x<-seq(0,100,by=1) >
+ y<-dweibull(x,shape = 2.5,scale=1) > plot(x,y,main='
+ función de densidad Weibull',col='blue')
Error in dweibull(x, shape = 2.5, scale = 1) : object 'x' not found
> x<-seq(0,100,by=1)
> > y<-dweibull(x,shape = 2.5,scale=1)
Error: unexpected '>' in ">"
> plot(x,y,main=' función de densidad Weibull',col='blue')
Error in xy.coords(x, y, xlabel, ylabel, log) : object 'y' not found
> > y<-dweibull(x,shape = 2.5,scale=1)
Error: unexpected '>' in ">"
> plot(x,y,main=' función de densidad Weibull',col='blue')
Error in xy.coords(x, y, xlabel, ylabel, log) : object 'y' not found
> y<-dweibull(x,shape = 2.5,scale=1)
>
> plot(x,y,main=' función de densidad Weibull',col='blue')
> plot(x,y,type=1,main=' función de densidad Weibull',col='blue')
Error in plot.xy(xy, type, ...) : tipo de gráfico inválido
> plot(x,y,type=1,main=' función de densidad Weibull',col='blue')
Error in plot.xy(xy, type, ...) : tipo de gráfico inválido
> plot(x,y,type='1'',main=' función de densidad Weibull',col='blue')
Error: unexpected string constant in " plot(x,y,type='1'',main='"
> plot(x,y,main=' función de densidad Weibull',col='blue')
> plot(x,y,main=' función de densidad Weibull',col='blue')
>
> mrank.observation <- function (j, f){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.observation()
+ r <- qbeta(0.5, j, f - j + 1);r}
> mrank.data <- function (data = NULL){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.data()
+ n <- nrow(data)
+ data$rank <- rank(data$ob, ties.method =
+ "first")
+ data$rrank <- (n + 1 - data$rank)
+ sdata <- data[order(data$rank), ]
+ sdata$arank <- sdata$rank
+ sdata$mrank <-
+ mrank.observation(sdata$arank, n)
+ data <- sdata[!is.na(sdata$mrank), ];data}
> d <- data.frame(ob=c(149971, 70808, 133518,
+ 145658, 175701, 50960, 126606, 82329), state=1)
> d <- m
Error: object 'm' not found
> mrank.observation <- function (j, f){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.observation()
+ r <- qbeta(0.5, j, f - j + 1);r}
> mrank.data <- function (data = NULL){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.data()
+ n <- nrow(data)
+ data$rank <- rank(data$ob, ties.method =
+ "first")
+ data$rrank <- (n + 1 - data$rank)
+ sdata <- data[order(data$rank), ]
+ sdata$arank <- sdata$rank
+ sdata$mrank <-
+ mrank.observation(sdata$arank, n)
+ data <- sdata[!is.na(sdata$mrank), ];data}
> d <- data.frame(ob=c(149971, 70808, 133518,
+ 145658, 175701, 50960, 126606, 82329), state=1)
> d <- m
Error: object 'm' not found
> mrank.observation <- function (j, f){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.observation()
+ r <- qbeta(0.5, j, f - j + 1);r}
> mrank.data <- function (data = NULL){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.data()
+ n <- nrow(data)
+ data$rank <- rank(data$ob, ties.method =
+ "first")
+ data$rrank <- (n + 1 - data$rank)
+ sdata <- data[order(data$rank), ]
+ sdata$arank <- sdata$rank
+ sdata$mrank <-
+ mrank.observation(sdata$arank, n)
+ data <- sdata[!is.na(sdata$mrank), ];data}
> d <- data.frame(ob=c(149971, 70808, 133518,
+ 145658, 175701, 50960, 126606, 82329), state=1)
> d <- mrank.data(d)
> mrank.observation <- function (j, f){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.observation()
+ r <- qbeta(0.5, j, f - j + 1);r}
> mrank.data <- function (data = NULL){
+ # slimmed-down version of
+ # Weibulltoolkits mrank.data()
+ n <- nrow(data)
+ data$rank <- rank(data$ob, ties.method =
+ "first")
+ data$rrank <- (n + 1 - data$rank)
+ sdata <- data[order(data$rank), ]
+ sdata$arank <- sdata$rank
+ sdata$mrank <-
+ mrank.observation(sdata$arank, n)
+ data <- sdata[!is.na(sdata$mrank), ];data}
> d <- data.frame(ob=c(149971, 70808, 133518,
+ 145658, 175701, 50960, 126606, 82329), state=1)
> d <- mrank.data(d)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> x<-seq(0,100,by=1) y<-dweibull(x,shape = 2.5,scale=1) plot(x,y,main=' función de
densidad Weibull',col='blue')
Error: unexpected symbol in "x<-seq(0,100,by=1) y"
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 12.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 1,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 1,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 1,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
>
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 1,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> m <- 100
> x <- rweibull3(10,3,1,m)
Error in rweibull3(10, 3, 1, m) : could not find function "rweibull3"
> dweibull3(x,3,1,m)
Error in dweibull3(x, 3, 1, m) : could not find function "dweibull3"
> dweibull(x-m,3,1)
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[59] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
> m <- 100
> x <- rweibull3(10,3,1,m)
Error in rweibull3(10, 3, 1, m) : could not find function "rweibull3"
> dweibull3(x,3,1,m)
Error in dweibull3(x, 3, 1, m) : could not find function "dweibull3"
> dweibull(x-m,3,1)
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[59] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-pweibull(x,shape = 2.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-pweibull(x,shape = 1,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,100,by=1)
> y<-pweibull(x,shape = 0.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,10,by=1)
> y<-pweibull(x,shape = 0.5,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,10,by=1)
> y<-pweibull(x,shape = 3.44,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,10,by=1)
> y<-dweibull(x,shape = 3.44,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,5,by=1)
> y<-dweibull(x,shape = 3.44,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
>
>
>
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1.5,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Weibull density")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(alpha~'=1.5'), expression(alpha~'=2'),
expression(alpha~'=2.5'), expression(alpha~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Pdf Weibull density with"," ",theta,"=100"," ", "and
varying shape")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,1.5,3,0.5)
Error in seq.default(1, 1.5, 3, 0.5) : too many arguments
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Weibull density")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(alpha~'=1.5'), expression(alpha~'=2'),
expression(alpha~'=2.5'), expression(alpha~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Pdf Weibull density with"," ",theta,"=100"," ", "and
varying shape")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Weibull density")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(alpha~'=1.5'), expression(alpha~'=2'),
expression(alpha~'=2.5'), expression(alpha~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Pdf Weibull density with"," ",theta,"=100"," ", "and
varying shape")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(alpha~'=1.5'), expression(alpha~'=2'),
expression(alpha~'=2.5'), expression(alpha~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(alpha~'=2'),
expression(alpha~'=2.5'), expression(alpha~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> z<- seq(0,5,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(1,1,1)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> z<- seq(0,5,by=1)
>
> scaleparam <- seq(1,1,1)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 1), ylim=c(0,2), type = "l",
ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 1), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,type="l",main=' función de densidad Weibull',col='blue')
>
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,type="l",main='densidad Weibull',col='blue')
> z<- seq(0,5,by=1)
>
> scaleparam <- seq(1,1,1)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 1), ylim=c(0,2), type = "l",
ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 1), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> x<-seq(0,100,by=1)
> y<-dweibull(x,shape = 2.5,scale=1)
> plot(x,y,type="l",main='densidad Weibull',col='blue')
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> x<-seq(0,5,by=1)
> y<-dweibull(x,shape = 3.44,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> x<-seq(0,5,by=1)
> y<-dweibull(x,shape = 3.44,scale=1)
> plot(x,y,main=' función de densidad Weibull',col='blue')
> > pweibull(0.75, 4.5, scale = 4^(1/4.5), lower.tail = F)
Error: unexpected '>' in ">"
> pweibull(0.75, 4.5, scale = 4^(1/4.5), lower.tail = F)
[1] 0.9337898
> qweibull(0.95, 4.5, scale = 4^(1/4.5), lower.tail = F)
[1] 0.7032956
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> z<- seq(0,400,by=1)
>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> d=rnorm(30,100,10)
> d
[1] 129.50470 88.32339 82.45394 113.29551 92.69636 97.11771 93.39016 82.67420
[9] 85.87423 107.11103 91.84818 100.51692 105.04535 109.41092 106.68480 91.08723
[17] 104.21868 92.35605 101.81670 117.81351 95.40163 98.40876 104.02924 115.38454
[25] 105.35638 107.34114 86.16715 97.76077 102.02714 93.09185
> hist(d)
> mean(d)
[1] 99.94027
> sd(10)
[1] NA
> sd(d)
[1] 10.91679
> boxplot(d)
> help norm()
Error: unexpected symbol in "help norm"
> help norm(d)
Error: unexpected symbol in "help norm"
> m=mean(d)
> s=sd(d)
> ks.test(d,"pnorm",m,s)

One-sample Kolmogorov-Smirnov test

data: d
D = 0.092415, p-value = 0.9391
alternative hypothesis: two-sided

> z<- seq(0,400,by=1)


>
> scaleparam <- seq(50,200,50)
> shapeparam <- seq(1,3,0.5)
>
> # varying the shape parameter
> plot(z, dweibull(z, shape = shapeparam[1], scale = 100), ylim=c(0,0.012), type =
"l", ylab = "Densidad Weibull")
>
> for(k in 2:length(shapeparam)){
+ lines(z,dweibull(z,shape = shapeparam[k], scale = 100), col = k)
+ }
>
> legend("topright", c(expression(beta~'=1'), expression(beta~'=2'),
expression(beta~'=2.5'), expression(beta~'=3')), lty=1, col = 1:4)
> title(substitute(paste("Densidad Weibull")))
> pnorm(0.975)
[1] 0.8352199
> qtukey()
Error in qtukey() : argument "p" is missing, with no default
> qtukey()
Error in qtukey() : argument "p" is missing, with no default
>
>
> qt(0.975,29)
[1] 2.04523
> num=mean(d)-500
> den=sd(d)/sqrt(30)
> ec=num/den
> ec=num/den
> ec
[1] -200.7199
>

You might also like