NavigationUser login |
DylanAggregating SSURGO Data in RSubmitted by dylan on Thu, 2009-09-10 15:36.
If you happen to have some of the SSURGO tabular data that includes column names, the following R code may be of general interest for resolving the 1:many:many hierarchy of relationships required to make a thematic map.
mukey clay silt sand water_storage
458581 20.93750 20.832237 20.861842 14.460000
458584 43.11513 30.184868 26.700000 23.490000
458593 50.00000 27.900000 22.100000 22.800000
458595 34.04605 14.867763 11.776974 18.900000
( categories: )
Making Sense of Large Piles of Soils Information: Soil TaxonomySubmitted by dylan on Wed, 2009-05-27 18:43.
( categories: )
Simple Approach to Converting GRASS DB-backendsSubmitted by dylan on Sat, 2009-05-23 21:32.
Currently GRASS uses a single SQLite (file-based) database per mapset-- convenient if you are interested in joining attribute tables between vectors; but not set-in-stone as the final approach that will be used by default in GRASS 7. Regardless, converting the back-end is a fairly simple matter. Finally, taking the time to convert to an SQLite or Postgresql back-end will undoubtably save you time and sanity if you ever find yourself working with vector+attribute data on a regular basis. Having access to a complete implementation of SQL can make extracting, summarizing, joining, and re-formatting (column names, types, etc.) tabular data much simpler than what is available in the DBF back-end. Also, there are several convenient graphical SQLite managers available, such as SQLite manager, SQLite data browser, and SQLite Admin. ( categories: )
Interesting R PackagesSubmitted by dylan on Mon, 2009-04-27 15:47.
( categories: )
Checking Type LocationsSubmitted by dylan on Mon, 2009-04-20 22:18.
-- NAD27 to NAD83 echo 119d7\'4\"W 36d23\'13\"N | cs2cs +proj=latlong +datum=NAD27 +to +proj=latlong +datum=NAD83 -f "%.6f" ( categories: )
Main Characterization and Monitoring SitesSubmitted by dylan on Tue, 2009-03-10 06:28.
( categories: )
Comparison of Slope and Intercept Terms for Multi-Level Model II: Using ContrastsSubmitted by dylan on Tue, 2009-02-17 04:43.
PremiseSmall update to a similar thread from last week, on the comparison of slope and intercept terms fit to a multi-level model. I finally figured out (thanks R-Help mailing list!) how to efficiently use contrasts in R. The C() function can be called within a model formula, to reset the base level of an un-ordered factor. The UCLA Stats Library has an extensive description of this topic here. This approach can be used to sequentially test for differences between slope and intercept terms from a multi-level model, by re-setting the base level of a factor. See example data and figure below. Note that the multcomp package has a much more robust approach to this type of operation. Details below. # need these library(lattice) library(Design) # replicate an important experimental dataset set.seed(10101010) x <- rnorm(100) y1 <- x[1:25] * 2 + rnorm(25, mean=1) y2 <- x[26:50] * 2.6 + rnorm(25, mean=1.5) y3 <- x[51:75] * 2.9 + rnorm(25, mean=5) y4 <- x[76:100] * 3.5 + rnorm(25, mean=5.5) d <- data.frame(x=x, y=c(y1,y2,y3,y4), f=factor(rep(letters[1:4], each=25))) # plot xyplot(y ~ x, groups=f, data=d, auto.key=list(columns=4, title='Beard Type', lines=TRUE, points=FALSE, cex=0.75), type=c('p','r'), ylab='Number of Pirates', xlab='Distance from Land') ( categories: )
Aggregating Soil Survey Information: Available Water Holding CapacitySubmitted by dylan on Sat, 2009-01-31 23:53.
Horizon thickness-weighted mean AWC (available water holding capacity), aggregated to a 4km grid, based on the detailed (SSURGO) soil survey database. Each grid cell is the component percentage / area fraction weighted mean of profile AWC. The variation in AWC tracks several important parent material induced patterns: with lower AWC in residual soils formed on steep granitic terrain (south flank of Sierra Nevada), and higher AWC in residual soils formed on the gentler slopes of meta-volcanic and meta-sedimentary terrain (central and northern flanks of Sierra Nevada). The higher AWC values one the east side of the San Joaquin Valley correspond with the characteristically finer soils formed from coast range alluvium. High AWC values of the Sacramento Valley correspond with the fine textured soils derived from a mixture of coast range alluvium, and meta-volcanic/sedimentary alluvium from the Sierra Nevada. ( categories: )
Comparison of Slope and Intercept Terms for Multi-Level ModelSubmitted by dylan on Thu, 2009-01-29 18:23.
PremiseWhen the relationship between two variable is (potentially) dependent on a third, categorical variable ANCOVA (analysis of covariance), or some variant, is commonly used. There are several approaches to testing for differences in slope/intercepts (in the case of a simple linear model) between levels of the stratifying variable. In R the following formula notation is usually used to test for interaction between levels of a factor (f) and the relationship between two continuous variables x and y: y ~ x * f. A simple graphical exploration of this type of model can be done through examination of confidence intervals computed for slope and intercept terms, for each level of our grouping factor (f). An example of a fictitious dataset is presented below. Note that this a rough approximation for testing differences in slope/intercept within a multi-level model. A more robust approach would take into account that we are trying to make several pair-wise comparisons, i.e. something akin to Tukey's HSD. Something like this can be done with the multcomp package. For any real data set you should always consult a real statistician.
# need this for xyplot() library(lattice) # make some fake data: x <- rnorm(100, mean=3, sd=6) y <- x * runif(100, min=1, max=7) + runif(100, min=1.8, max=5) d <- data.frame(x, y, f=rep(letters[1:10], each=10)) # check it out xyplot(y ~ x | f, data=d, type=c('p','r')) ( categories: )
|