Note: This page is designed to show the how multilevel model can be done using R and to be able to compare the results with those in the book. On…
Read More
Search Results for: stata
Multilevel Analysis Techniques and Applications, Chapter 2 | R Textbook Examples
library(foreign) library(lme4) Table 2.1 on page 17 using the popular dataset. Part 1: Intercept only. popdata<-read.dta(“https://stats.idre.ucla.edu/stat/stata/examples/mlm_ma_hox/popular.dta”) m2.1.1<-lmer(popular ~ (1|school), popdata) summary(m2.1.1) Linear mixed model fit by REML Formula: popular ~…
Read More
Multilevel Analysis Techniques and Applications, Chapter 4 | R Textbook Examples
library(foreign) library(lme4) Table 4.1 on page 57 using the popular dataset. popdata<-read.dta(“https://stats.idre.ucla.edu/stat/stata/examples/mlm_ma_hox/popular.dta”) Part 1 m4.1.1 Linear mixed model fit by REML Formula: popular ~ sex + (1 | school)…
Read More
Multilevel Analysis Techniques and Applications, Chapter 7 | R Textbook Examples
Table 7.1 on page 126 using the pupcross dataset. Part 1: Intercept only. library(foreign) library(lme4) pupcross<-read.dta(“https://stats.idre.ucla.edu/stat/stata/examples/mlm_ma_hox/pupcross.dta”) m1<-lmer(achiev ~ (1|sschool) + (1|pschool), pupcross, REML=FALSE) summary(m1) Linear mixed model fit by maximum…
Read More
How do I perform Multiple Imputation using Predictive Mean Matching in R? | R FAQ
Predictive Mean Matching (PMM) is a semi-parametric imputation approach. It is similar to the regression method except that for each missing value, it fills in a value randomly from among…
Read More
How can I “collapse” my data in R? | R FAQ
Users of Stata are likely familiar with the concept of collapsing data: reducing the number of observations in your data, keeping one observation for each value or combination of values…
Read More
How can I explain a continuous by continuous interaction? | R FAQ
This page is an attempt to translate into R the parts of the equivalent Stata FAQ page. First off, let’s start with what a significant continuous by continuous interaction means….
Read More
How to Input data into R | R FAQ
Importing formatted data files using the functions in the foreign package The foreign package contains functions that will allow you to import data files from some of the most commonly…
Read More
Inputting data into SPLUS | R FAQ
Opening SPLUS Data Files Using the File Menu Opening SPLUS Data Files Using the openData Function Importing Formatted Data Files Using the Import Menu Importing Formatted Data files Using the…
Read More
Random Coefficient Poisson Models | R FAQ
Version info: Code for this page was tested in R Under development (unstable) (2012-07-05 r59734) On: 2012-07-08 With: knitr 0.6.3 Please Note: The purpose of this page is to show…
Read More
