Recent content by Lazar

  1. Lazar

    IV Regression with binary outcome

    I have a binary variable y which I am aiming to model using instrumental variable regression. Both X and the IV are continuous. ivpak in R does not seem to provide a means for accounting for a binary outcome. Is there a means of accounting for this in R?
  2. Lazar

    Linear Probability Models and Complex Survey Data

    So there has been a movement back toward linear probability models in cases in which multi-group comparisons are of focal interest. The rational for this is that cross-group comparisons of parameter estimates get shaky in probit and logit models requiring a bunch of finessing to get right...
  3. Lazar

    rmongodb: Return count of all instances within a document

    I have a mongodb with 21,000 documents. The fields include: _id, dateOfSpeech, speaker, speechType, and speechTranscript. I want to construct a query of the speechTranscript field that returns the count of the number of times a given pattern occurs in a document. So far I have only been able...
  4. Lazar

    linear probability models: heteroscedasticity

    I have to run linear probability models rather than logistic regression models (dichotomous endogenous variable) and I am wanting to look for a way of dealing with heteroscedasticity to get correct standard errors. I wonder whether using robust weighted least squares in the R package lavaan for...
  5. Lazar

    GIS data questions

    Hi All, I have to get some GIS data for a project I am working on but I honestly have no idea where to start. What I need is as follows: 1. I need to get the lat and long of the point in a post/zip code with the highest population density (post codes are from Australia). I have the geographic...
  6. Lazar

    makefile knitr

    Ok so I want to make a makefile that will find all .Rmd files and convert them to html files. I have a make file the works but I want to work loop through the .Rmd and then .md files. Here is what I have so far: # test comment all: Day1Part1-Introduction.md Day1Part1-Introduction.html \...
  7. Lazar

    weighted correlation

    Hi Folks, So I have data that looks like: myData <- structure(list(total = c(0.154, 0.223, 0.252, 0.157, 0.196, 0.252, 0.198, 0.162, 0.222, 0.135, 0.196, 0.193, 0.192, 0.274, 0.177, 0.17, 0.214, 0.214, 0.107, 0.22, 0.177, 0.177, 0.165, 0.226, 0.196, 0.267, 0.174, 0.12, 0.159), totalse...
  8. Lazar

    Cross-classification BUGS

    Hi All, I have a hierarchical Bayes model that looks like: model{ #Overaching model for (i in 1:n){ y[i] ~ dnorm (yHat[i], tau.y) yHat[i] <- a[id[i]] + b.group*group[i] + b.wave*wave[i] + b.int*wave[i]*group[i] } #Fixed Effects b.group ~ dnorm(0, .0001) b.wave ~...
  9. Lazar

    Add Regular Expressions RSQLite

    So I want to add regular expressions to sqlite for queries via R. SQLite does not come with regular expressions but has keywords assigned and thus you have to add the functionality yourself http://www.ashleyit.com/blogs/brentashley/2013/11/27/using-regular-expressions-with-sqlite/ So anyone...
  10. Lazar

    Calling Python from R

    So I am trying to call python from R so I can use beautiful soup. I have tried both >system("python myfile.py") and >library(rPython) >python.exec("import bs4 some more python script here") The issue I am running into in both cases is I get back "No module named bs4" I think the...
  11. Lazar

    readShapeSpatial

    Hi All, I am trying to read into R the .shp file for Postal Areas ASGS Non ABS Structures Ed 2011 Digital Boundaries in ESRI Shapefile Format from http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.003July%202011?OpenDocument When I work with other files from this area (e.g...
  12. Lazar

    API for Australian Bureau of Statistics

    Ok so there are APIs for US census data where you feed it geodata and get back a whole bunch of demographics data back. I use http://www.datasciencetoolkit.org/ for this purpose. I wonder (and this is a long shot) if anyone knows something similar for Australian Census Data from the ABS. In...
  13. Lazar

    Contextual Effect Question

    I am looking for general thoughts on the following circumstance. I am working on a problem for a colleague in which he has some outcome Y at T2 that he wants to predict by a contextual effect: school average Y at T1. He does not want to estimate change so he has estimates a model: yT2 ~...
  14. Lazar

    SQLite select from based on Pivot of another table

    Ok I have a database that includes two tables. A datatable that looks like: a b c d e f g h i 1 -2.1772586 0.54904839 -0.09064777 -0.30904735 0.902645747 0.25056056 -0.07167768 0.5477423 -0.06540162 2...
  15. Lazar

    Bayes CFA

    Hi Folks, I have several questions about Bayes CFA in Open bugs that I hope you might be able to help me out with. First the setup: Here is a basic two factor CFA set up for the HS data that is available in several R packages ###Bugs CFA model 2 factors. All cross loadings zero###...