Skip to content

Instantly share code, notes, and snippets.

@aniversarioperu
Last active December 26, 2015 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniversarioperu/7083834 to your computer and use it in GitHub Desktop.
Save aniversarioperu/7083834 to your computer and use it in GitHub Desktop.
análisis estadistico de Qali Warma
require(stats)
library(ggplot2)
x <- read.csv("tabla31.csv", header=FALSE)
plot(x$V3, x$V2, xlim=c(0,200), ylim=c(0,
70),
ylab="Déficit calórico",
xlab="Presupuesto de Gasto por niño (PIM)",
main="Hay correlación entre gasto y déficit calórico?\nPrimicia: NO hay!")
reg_lineal <- lm(x$V3 ~ x$V2)
abline(lsfit(x$V3, x$V2))
summary(reg_lineal)
# grafico de ejemplo
sale5 <- c(13, 12, 12, 11, 12, 10, 7, 9, 8, 6)
plot(sale5, main="Ejemplo de correlación lineal significativa", las=1)
abline(lsfit(1:10,sale5))
summary(lm(1:10 ~ sale5))
# Tabla 4
x <- read.csv("tabla4.csv", header=FALSE)
names(x) <- c("departamento", "porcentaje_pobres","gasto")
plot(x$porcentaje_pobres, x$gasto, xlim=c(0,80), ylim=c(0,2100),
main="\"A mayor pobreza hay menor gasto\":\nLos datos no te respaldan!",
xlab="Tasa de pobreza multidimensional",
ylab="Gasto social per capita",
las=1)
reg_lineal <- lm(x$porcentaje_pobres ~ x$gasto)
abline(lsfit(x$porcentaje_pobres, x$gasto))
summary(reg_lineal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment