This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Procesos productivos reales

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Aplicación de análisis estadístico en la Industria Farmacéutica

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Formas farmacéuticas líquidas, sólidas y semisólidas

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Aplicación de análisis estadístico en la Industria Farmacéutica

Análisis univariado y multivariado, pruebas de comparación, Diseño experimental, Control de CAlidad, Quality by Design

sábado, 14 de mayo de 2016

Verificación de supuestos

### Verificación de supuestos ###

resi<-residuals(MOD)
stdresid<-rstandard(MOD)
#par(mfrow=c(2,2))
#plot(MOD)

#shapiro:Para normalidad
#Ho:Hay normalidad
#Ha:No hay normalidad
#shapiro.test(rnorm(100,0,1))
shapiro.test(resi) #Si son normales los residuos


#Kolmogorov-Smirnov: Para normalidad
#Ho:Hay normalidad (No hay diferencia significativa entre la distribucion evaluada y una distribucion normal)
#Ha:No hay normalidad (Si hay diferencia significativa entre la distribucion evaluada y una distribucion normal)
#prueba<-rnorm(100,0,1)
#ks.test(prueba,"pnorm",mean=mean(prueba), sd=sd(prueba))
ks.test(resi,"pnorm",mean=0, sd=sd(resi))

#Barlett: Para homogeneidad de varianzas

with(tabla, tapply(ESP_NUC_PROC, LOTE, var, na.rm=TRUE))
bartlett.test(ESP_NUC_PROC ~ LOTE, data=tabla) 
#Aca necesariamente toca poner la variable que
#se esta analizando y los grupos, tal cual como esta escrito
#en el modelo arriba

with(tabla, tapply(ESP_NUC_PROC, LOTE, var, na.rm=TRUE))
leveneTest(ESP_NUC_PROC ~ LOTE, data=tabla, center="median")
#En el  test de Levene, se puede centrar por mediana o por promedio

with(tabla, tapply(ESP_NUC_PROC, LOTE, var, na.rm=TRUE))
leveneTest(ESP_NUC_PROC ~ LOTE, data=tabla, center="mean")

### Falta el test de aleatoriedad - No-paramétrico
bartlett.test(resi~MOD)

jueves, 12 de mayo de 2016

Ingreso de datos

### Ingreso de datos ###
# 1. Se puede ingresar los datos directamente, así:
x=c(499.3361, 500.3681, 501.2236, 498.3309, 499.0955, 501.4942, 500.3857, 499.7793, 499.7361, 502.3487, 499.6574, 500.1297, 500.2847, 498.2438, 498.8386, 499.5641, 498.9991, 499.7621, 500.6080, 499.1800, 500.2351, 499.6674, 499.2542, 500.6901, 500.8001, 499.7816, 500.0355, 500.6031, 501.2470)
# 2. Se puede ingresar los datos, tomados directamente de archivos de excel, así:
# En este caso se requieren las siguientes librerias: (xlsx), (rJava),(xlsxjars)
setwd("C:/Users/admin/Desktop/prueba")
datos<-read.xlsx("datos.xlsx","datos", header=TRUE)
# 1. Se puede ingresar directamente del enlace de internet, así:
datos<-read.table ("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data",sep=",")


Análisis descriptivo

### Análisis descriptivo ###

#Una vez se ha ingresado la variable de interés como "x" (Ver: ### Ingreso de datos ###), seguir el siguiente script

#n

length(x)

#Promedio
mean(x)

#Mediana
median(x)

#Varianza muestral (dividida por n-1)
var(x)

#Varianza poblacional:
var(x)*(n-1)/n   #donde n=número de datos


#Desviación estándar muestral 
(dividida por n-1) 
sd(x)

#Coeficiente de variación
(sd(x)/mean(x))*100

#Rango
max(x)-min(x)

#Moda
estimate_mode <- function(x)
{
d <- density(x)
d$x[which.max(d$y)]
}
estimate_mode(x)