Publications by Victor Feagins
Playing with Rjags
Packages —- library(rjags) #Uses JAGS to create bayesian models ## Loading required package: coda ## Linked to JAGS 4.3.0 ## Loaded modules: basemod,bugs library(coda) library(tidyverse) #Utility functions ## ── Attaching packages ─────────────────────────────────────...
2347 sym R (7526 sym/62 pcs) 15 img
INLA Homework
df<- haven::read_sas("C:/Users/victo/OneDrive - University of Texas at San Antonio/Classes/Fall 2021/Spatial Anaylsis/HW 4/AHRF_2020-2021_SAS/AHRF2021.sas7bdat") labels <- sapply(1:ncol(df), function(x){attr(df[[x]], "label")}) %>% cbind("Variable_Name"=names(df),"Label"=.) I want to see if the number of doctors in a county are influenced by ...
2661 sym R (11521 sym/24 pcs) 5 img 2 tbl
For a friend
df <- iris We can fit various distributions to data. If we look at the Sepal.Width in the iris dataset it seems to be normal. ggplot(df, mapping = aes(x = Sepal.Width))+ geom_histogram(aes(y = ..density..), color="black", fill="white")+ geom_density() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. We can do a statist...
844 sym R (512 sym/8 pcs) 1 img
Spatial Demography HW 5
Calculate segregation indices for a geography of your choosing, calculate two indices of segregation. What are the two groups you used for your index? Create a map and a descriptive summary of your indices Data Downloading ACS Table B03002 Hispanic Origin by Race for the State of California. race_table10 <- get_acs(geography = "tract", ...
1690 sym R (2651 sym/11 pcs) 4 img
Spatial HW 4
library(dplyr) library(spatialreg) library(spdep) library(MASS) library(ggplot2) library(sf) library(tigris) df<- haven::read_sas("AHRF_2020-2021_SAS/AHRF2021.sas7bdat") labels <- sapply(1:ncol(df), function(x){attr(df[[x]], "label")}) %>% cbind("Variable_Name"=names(df),"Label"=.) I want to see if the number of doctors in a county are ...
2259 sym R (13510 sym/35 pcs) 3 img 2 tbl
HW 3 Spatial
Data In this assignment we will be looking at handling spatial properties of US counties using a spatial regimes model. usco.s <- st_simplify(usco, dTolerance = 2000) ggplot(usco.s)+ geom_sf() + labs(title = "United States Counties") We will be merging it with United States Regions ggplot(us_states)+ geom_sf(aes(fill = REGION)) + la...
2681 sym R (4250 sym/22 pcs) 3 img 9 tbl
Survival Analysis
Question 1 Consider the mortality table based on 608 known deaths of Dall Mountain Sheep. The data are expressed per 1,000 sheep on the table below Compute and plot the Survival Function Surv.1 <- Surv(time = df.1.t$Start_Interval, time2 = df.1.t$End_Interval, event = rep(1, nrow(df.1.t)), type = "interval") summary(fit.1 <...
3778 sym R (4982 sym/16 pcs) 4 img 5 tbl
Survival Analysis HW 2
4.1 Consider the survival time of the 30 melanoma patients in Table 3.1. df.3.1 <- read_excel("Table 3.1.xlsx") ## New names: ## * Uncensor -> Uncensor...10 ## * Uncensor -> Uncensor...12 head(df.3.1, 10) %>% flextable() %>% set_caption("First 10 Observations") Compute and plot the PL estimates of the survivorship functions \(S(t)\) o...
1713 sym R (6425 sym/28 pcs) 5 img 4 tbl
Survival Analysis HW Chapter 2
Exercise 2.1 Consider the survival data given in Exercise Table 2.1 and compute and plot the estimated survivorship, the probability density and the hazard functions. Survivorship Function Survivorship is the probability that an individual survives longer than t. It is estimated with the following equation: \[\hat{S}(t) = \frac{number\;of\;items...
2786 sym R (2292 sym/12 pcs) 6 img 8 tbl
HW Chapter 2 Survival Analysis
Exercise 2.1 Consider the survival data given in Exercise Table 2.1 and compute and plot the estimated survivorship, the probability density and the hazard functions. Survivorship Function Survivorship is the probability that an individual survives longer than t. It is estimated with the following equation: \[\hat{S}(t) = \frac{number\;of\;items...
1777 sym R (2292 sym/12 pcs) 6 img 8 tbl