Search results

  1. Lazar

    Repeated Measures RCT mediation help

    I have a repeated measures dataset with baseline and 12 and 24 month follow-up. I need to fit a mediation model to this data. I am unsure whether my approach (see below) makes sense. The questions I have are: 1. If the model has Poisson link function for the outcome is the traditional a*b...
  2. Lazar

    R to collaborative Google Docs workflow ideas

    TL;DR; I am looking for workflow ideas to dynamically import tables and figures into a google doc that I am working on collaboratively with multiple people. I find myself working a lot with colleagues on google docs who are not sufficiently familiar with R or markdown to use .Rmd files. I am...
  3. 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?
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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 \...
  9. 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...
  10. 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 ~...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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 ~...
  16. 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...
  17. 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###...
  18. Lazar

    Predicting Random Slopes

    I have a model as follows: Level 1 (students): Variables = educational aspirations (expect) and socioeconomic status (ses) Level 2 (schools): not interested in this level just controlling for it Level 3 (countries): Variables = educational equity (ICC) the models is...
  19. Lazar

    xyplot from summary data

    Ok so here is a data set in which I have means for males and females and their SEs (MSE and FSE respectively) along with a factor and a year in school (grade): I want to create a xyplot as follows: library(lattice) xyplot(Males+Females~Grade|factor, data=data, relation="free"...
  20. Lazar

    Export .csvout of SPSS

    HI All, For a training course I have to leave R and dabble in SPSS. I have not used the programme in sometimes and cannot remeber even some very basic stuff. Basically I need to export an SPSS file to a .csv file in which there are no headings, no string variables and missing are...