Getting Packages Ready

library(tidyLPA)
## Warning: package 'tidyLPA' was built under R version 4.3.2
## You can use the function citation('tidyLPA') to create a citation for the use of {tidyLPA}.
## Mplus is not installed. Use only package = 'mclust' when calling estimate_profiles().
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.3.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(mclust)
## Warning: package 'mclust' was built under R version 4.4.0
## Package 'mclust' version 6.0.1
## Type 'citation("mclust")' for citing this R package in publications.

Import Data

Data <- read.csv("G:\\Shared Data\\Research\\Administration\\Evaluation\\Assessment\\2023 Amira Study\\Data\\Exploratory Analysis\\Latent Profile Analysis - For R.csv")

Descriptive on Data

summary(Data)
##  StudentNumber        Gender      RaceEthnicity   EBFEligibility  
##  Min.   :533644   Min.   :0.000   Min.   :0.000   Min.   :0.0000  
##  1st Qu.:591942   1st Qu.:0.000   1st Qu.:1.000   1st Qu.:0.0000  
##  Median :602289   Median :0.000   Median :1.000   Median :1.0000  
##  Mean   :599838   Mean   :0.495   Mean   :1.517   Mean   :0.7319  
##  3rd Qu.:612370   3rd Qu.:1.000   3rd Qu.:2.000   3rd Qu.:1.0000  
##  Max.   :628036   Max.   :1.000   Max.   :6.000   Max.   :1.0000  
##                                                                   
##    SpecialEd      HighAbilityLearner ConvertedELStatus     Grade     
##  Min.   :0.0000   Min.   :0.00000    Min.   :0.0000    Min.   :0.00  
##  1st Qu.:0.0000   1st Qu.:0.00000    1st Qu.:0.0000    1st Qu.:0.00  
##  Median :0.0000   Median :0.00000    Median :0.0000    Median :1.00  
##  Mean   :0.1816   Mean   :0.05433    Mean   :0.4484    Mean   :1.48  
##  3rd Qu.:0.0000   3rd Qu.:0.00000    3rd Qu.:1.0000    3rd Qu.:2.00  
##  Max.   :1.0000   Max.   :2.00000    Max.   :2.0000    Max.   :3.00  
##                                                                      
##  MAP.School.change..Fall.2022...Spring.2023. MAP.Fall.RIT.Score
##  Min.   :0.00000                             Min.   :104.0     
##  1st Qu.:0.00000                             1st Qu.:143.0     
##  Median :0.00000                             Median :157.0     
##  Mean   :0.01864                             Mean   :159.7     
##  3rd Qu.:0.00000                             3rd Qu.:175.0     
##  Max.   :1.00000                             Max.   :231.0     
##  NA's   :296                                 NA's   :296       
##  MAP.Winter.RIT.Score MAP.Spring.RIT.Score   MAP.Growth    
##  Min.   :114.0        Min.   :113.0        Min.   :-30.00  
##  1st Qu.:150.0        1st Qu.:157.0        1st Qu.:  7.00  
##  Median :164.0        Median :172.0        Median : 13.00  
##  Mean   :166.5        Mean   :173.2        Mean   : 13.23  
##  3rd Qu.:183.0        3rd Qu.:189.0        3rd Qu.: 19.00  
##  Max.   :236.0        Max.   :239.0        Max.   : 78.00  
##  NA's   :352          NA's   :296                          
##  MAP.Fall.To.Spring.Projected.Growth MAP.Fall.To.Spring.Met.Projected.Growth
##  Min.   : 4.0                        Min.   :0.0000                         
##  1st Qu.:13.0                        1st Qu.:0.0000                         
##  Median :15.0                        Median :0.0000                         
##  Mean   :14.3                        Mean   :0.4783                         
##  3rd Qu.:16.0                        3rd Qu.:1.0000                         
##  Max.   :26.0                        Max.   :1.0000                         
##  NA's   :316                         NA's   :316                            
##  BOY.Dyslexia.Risk.Category MOY.Dyslexia.Risk.Category
##  Min.   :0.0000             Min.   :0.0000            
##  1st Qu.:0.0000             1st Qu.:0.0000            
##  Median :0.0000             Median :0.0000            
##  Mean   :0.1591             Mean   :0.1141            
##  3rd Qu.:0.0000             3rd Qu.:0.0000            
##  Max.   :1.0000             Max.   :1.0000            
##  NA's   :1771               NA's   :2300              
##  EOY.Dyslexia.Risk.Category EOY.Growth.Rate      BOY.ARM       
##  Min.   :0.000              Min.   :-2.2714   Min.   : -3.593  
##  1st Qu.:0.000              1st Qu.: 0.1370   1st Qu.:  4.503  
##  Median :0.000              Median : 0.4349   Median : 25.187  
##  Mean   :0.099              Mean   : 0.4234   Mean   : 39.993  
##  3rd Qu.:0.000              3rd Qu.: 0.6505   3rd Qu.: 69.204  
##  Max.   :1.000              Max.   : 1.8351   Max.   :219.558  
##  NA's   :2039               NA's   :1735      NA's   :1735     
##     MOY.ARM          EOY.ARM       ELPA21.Summative.Overall.Scale.Score
##  Min.   :  0.00   Min.   :  0.00   Min.   :2934                        
##  1st Qu.: 14.06   1st Qu.: 16.00   1st Qu.:4947                        
##  Median : 46.51   Median : 57.03   Median :5357                        
##  Mean   : 56.04   Mean   : 61.85   Mean   :5327                        
##  3rd Qu.: 92.88   3rd Qu.: 99.87   3rd Qu.:5734                        
##  Max.   :247.96   Max.   :223.39   Max.   :7032                        
##  NA's   :1735     NA's   :1735     NA's   :9265                        
##  ELPA.Reading.Scale.Score Amira.Weeks.Lapsed Amira.Average.Weekly.Practice
##  Length:14724             Min.   : 8.00      Min.   : 0.05263             
##  Class :character         1st Qu.:33.29      1st Qu.: 0.87022             
##  Mode  :character         Median :35.43      Median : 2.00000             
##                           Mean   :34.27      Mean   : 2.69495             
##                           3rd Qu.:37.00      3rd Qu.: 3.84299             
##                           Max.   :40.71      Max.   :34.76923             
##                           NA's   :143        NA's   :143                  
##  Amira.Usage.Met      X          
##  Min.   :0.00000   Mode:logical  
##  1st Qu.:0.00000   NA's:14724    
##  Median :0.00000                 
##  Mean   :0.09671                 
##  3rd Qu.:0.00000                 
##  Max.   :1.00000                 
##                                  
##  percentage.of.students.who.met.the.district.requirement
##  Length:14724                                           
##  Class :character                                       
##  Mode  :character                                       
##                                                         
##                                                         
##                                                         
## 

Estimation of profiles

prof1 <- Data %>%
  select(BOY.ARM, Grade, Amira.Weeks.Lapsed, Amira.Average.Weekly.Practice) %>%
  estimate_profiles(1:8)
## Warning in estimate_profiles_mclust(df_full, n_profiles, model_numbers, : The mclust algorithm does not allow for missing data. Some rows were omitted from analysis. Consider using Mplus, which accounts for cases with partially missing data, or use a non-parametric single imputation technique prior to analysis, such as the R-package 'missForest'.
## Warning: 
## One or more analyses resulted in warnings! Examine these analyses carefully: model_1_class_8
prof1
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC       BIC       Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       306806.85 306866.63 1.00    1.00     1.00     1.00  1.00        
##  1     2       299135.37 299232.50 0.85    0.95     0.97     0.50  0.50  0.01  
##  1     3       296432.37 296566.86 0.87    0.83     0.97     0.05  0.49  0.01  
##  1     4       293005.30 293177.15 0.82    0.83     0.94     0.04  0.43  0.01  
##  1     5       286188.17 286397.38 0.82    0.80     0.97     0.04  0.40  0.01  
##  1     6       284998.42 285245.00 0.80    0.75     0.97     0.02  0.31  0.01  
##  1     7       283527.51 283811.44 0.80    0.76     0.99     0.02  0.26  1.00  
##  1     8       282668.07 282989.36 0.82    0.79     0.97     0.01  0.28  0.01

Plot of the profiles

plot_profiles(prof1, rawdata=FALSE)

## Decided to look at group 2, 3, and 6

plot_profiles(prof1[[2]], rawdata=FALSE)

plot_profiles(prof1[[3]], rawdata=FALSE)

plot_profiles(prof1[[6]], rawdata=FALSE)

prof2 <- Data %>%
  select(BOY.ARM, Grade, Amira.Weeks.Lapsed, Amira.Average.Weekly.Practice) %>%
  estimate_profiles(2)
## Warning in estimate_profiles_mclust(df_full, n_profiles, model_numbers, : The mclust algorithm does not allow for missing data. Some rows were omitted from analysis. Consider using Mplus, which accounts for cases with partially missing data, or use a non-parametric single imputation technique prior to analysis, such as the R-package 'missForest'.
prof2
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC       BIC       Entropy prob_min prob_max n_min n_max BLRT_p
##  1     2       299134.68 299231.81 0.85    0.95     0.97     0.50  0.50  0.01
prof3 <- Data %>%
  select( BOY.ARM, Grade, Amira.Weeks.Lapsed, Amira.Average.Weekly.Practice) %>%
  estimate_profiles(3)
## Warning in estimate_profiles_mclust(df_full, n_profiles, model_numbers, : The mclust algorithm does not allow for missing data. Some rows were omitted from analysis. Consider using Mplus, which accounts for cases with partially missing data, or use a non-parametric single imputation technique prior to analysis, such as the R-package 'missForest'.
prof3
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC       BIC       Entropy prob_min prob_max n_min n_max BLRT_p
##  1     3       291035.55 291170.04 0.91    0.93     0.97     0.04  0.65  0.01
prof6 <- Data %>%
  select(BOY.ARM, Grade, Amira.Weeks.Lapsed, Amira.Average.Weekly.Practice) %>%
  estimate_profiles(6)
## Warning in estimate_profiles_mclust(df_full, n_profiles, model_numbers, : The mclust algorithm does not allow for missing data. Some rows were omitted from analysis. Consider using Mplus, which accounts for cases with partially missing data, or use a non-parametric single imputation technique prior to analysis, such as the R-package 'missForest'.
prof6
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC       BIC       Entropy prob_min prob_max n_min n_max BLRT_p
##  1     6       284999.05 285245.63 0.80    0.75     0.97     0.02  0.31  0.01

Estimates for the variables

get_estimates(prof2) 
## # A tibble: 16 × 8
##    Category  Parameter            Estimate      se         p Class Model Classes
##    <chr>     <chr>                   <dbl>   <dbl>     <dbl> <int> <dbl>   <dbl>
##  1 Means     BOY.ARM                64.4   5.04e-1 0             1     1       2
##  2 Means     Grade                   2.45  7.76e-3 0             1     1       2
##  3 Means     Amira.Weeks.Lapsed     35.2   5.24e-2 0             1     1       2
##  4 Means     Amira.Average.Weekl…    2.48  2.64e-2 0             1     1       2
##  5 Variances BOY.ARM              1071.    1.68e+1 0             1     1       2
##  6 Variances Grade                   0.325 1.75e-3 0             1     1       2
##  7 Variances Amira.Weeks.Lapsed     16.8   4.64e-1 5.35e-287     1     1       2
##  8 Variances Amira.Average.Weekl…    6.23  1.67e-1 3.44e-304     1     1       2
##  9 Means     BOY.ARM                16.5   2.62e-1 0             2     1       2
## 10 Means     Grade                   0.566 7.90e-3 0             2     1       2
## 11 Means     Amira.Weeks.Lapsed     34.3   4.82e-2 0             2     1       2
## 12 Means     Amira.Average.Weekl…    3.02  3.41e-2 0             2     1       2
## 13 Variances BOY.ARM              1071.    1.68e+1 0             2     1       2
## 14 Variances Grade                   0.325 1.75e-3 0             2     1       2
## 15 Variances Amira.Weeks.Lapsed     16.8   4.64e-1 5.35e-287     2     1       2
## 16 Variances Amira.Average.Weekl…    6.23  1.67e-1 3.44e-304     2     1       2
estimate3 <- get_estimates(prof3)
print(estimate3, n = 24) 
## # A tibble: 24 × 8
##    Category  Parameter             Estimate     se         p Class Model Classes
##    <chr>     <chr>                    <dbl>  <dbl>     <dbl> <int> <dbl>   <dbl>
##  1 Means     BOY.ARM                 90.6   0.460  0             1     1       3
##  2 Means     Grade                    2.39  0.0125 0             1     1       3
##  3 Means     Amira.Weeks.Lapsed      36.1   0.0379 0             1     1       3
##  4 Means     Amira.Average.Weekly…    2.68  0.0327 0             1     1       3
##  5 Variances BOY.ARM                480.    9.70   0             1     1       3
##  6 Variances Grade                    0.837 0.0107 0             1     1       3
##  7 Variances Amira.Weeks.Lapsed       6.55  0.0956 0             1     1       3
##  8 Variances Amira.Average.Weekly…    6.22  0.189  1.78e-238     1     1       3
##  9 Means     BOY.ARM                 16.5   0.208  0             2     1       3
## 10 Means     Grade                    1.06  0.0126 0             2     1       3
## 11 Means     Amira.Weeks.Lapsed      35.1   0.0285 0             2     1       3
## 12 Means     Amira.Average.Weekly…    2.88  0.0299 0             2     1       3
## 13 Variances BOY.ARM                480.    9.70   0             2     1       3
## 14 Variances Grade                    0.837 0.0107 0             2     1       3
## 15 Variances Amira.Weeks.Lapsed       6.55  0.0956 0             2     1       3
## 16 Variances Amira.Average.Weekly…    6.22  0.189  1.78e-238     2     1       3
## 17 Means     BOY.ARM                 27.0   1.55   6.44e- 68     3     1       3
## 18 Means     Grade                    1.46  0.0542 5.21e-159     3     1       3
## 19 Means     Amira.Weeks.Lapsed      19.2   0.210  0             3     1       3
## 20 Means     Amira.Average.Weekly…    1.46  0.117  3.93e- 36     3     1       3
## 21 Variances BOY.ARM                480.    9.70   0             3     1       3
## 22 Variances Grade                    0.837 0.0107 0             3     1       3
## 23 Variances Amira.Weeks.Lapsed       6.55  0.0956 0             3     1       3
## 24 Variances Amira.Average.Weekly…    6.22  0.189  1.78e-238     3     1       3
estimate6 <- get_estimates(prof6)
print(estimate6, n = 48) 
## # A tibble: 48 × 8
##    Category  Parameter            Estimate      se         p Class Model Classes
##    <chr>     <chr>                   <dbl>   <dbl>     <dbl> <int> <dbl>   <dbl>
##  1 Means     BOY.ARM                21.0   8.08e-1 8.96e-149     1     1       6
##  2 Means     Grade                   1.01  2.66e-2 0             1     1       6
##  3 Means     Amira.Weeks.Lapsed     36.7   4.05e-2 0             1     1       6
##  4 Means     Amira.Average.Weekl…    5.14  2.67e-1 1.83e- 82     1     1       6
##  5 Variances BOY.ARM               458.    1.12e+1 0             1     1       6
##  6 Variances Grade                   0.473 9.08e-3 0             1     1       6
##  7 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             1     1       6
##  8 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     1     1       6
##  9 Means     BOY.ARM                21.0   2.81e+0 7.51e- 14     2     1       6
## 10 Means     Grade                   0.943 8.85e-2 1.63e- 26     2     1       6
## 11 Means     Amira.Weeks.Lapsed     36.4   3.14e-1 0             2     1       6
## 12 Means     Amira.Average.Weekl…   12.7   8.67e-1 5.91e- 49     2     1       6
## 13 Variances BOY.ARM               458.    1.12e+1 0             2     1       6
## 14 Variances Grade                   0.473 9.08e-3 0             2     1       6
## 15 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             2     1       6
## 16 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     2     1       6
## 17 Means     BOY.ARM                36.0   8.13e-1 0             3     1       6
## 18 Means     Grade                   2.31  1.94e-2 0             3     1       6
## 19 Means     Amira.Weeks.Lapsed     35.2   8.34e-2 0             3     1       6
## 20 Means     Amira.Average.Weekl…    1.77  4.36e-2 0             3     1       6
## 21 Variances BOY.ARM               458.    1.12e+1 0             3     1       6
## 22 Variances Grade                   0.473 9.08e-3 0             3     1       6
## 23 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             3     1       6
## 24 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     3     1       6
## 25 Means     BOY.ARM                 9.95  2.62e-1 0             4     1       6
## 26 Means     Grade                   0.439 1.49e-2 2.05e-191     4     1       6
## 27 Means     Amira.Weeks.Lapsed     34.1   6.99e-2 0             4     1       6
## 28 Means     Amira.Average.Weekl…    1.79  4.81e-2 7.71e-304     4     1       6
## 29 Variances BOY.ARM               458.    1.12e+1 0             4     1       6
## 30 Variances Grade                   0.473 9.08e-3 0             4     1       6
## 31 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             4     1       6
## 32 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     4     1       6
## 33 Means     BOY.ARM                27.3   1.51e+0 8.01e- 73     5     1       6
## 34 Means     Grade                   1.46  5.76e-2 2.81e-142     5     1       6
## 35 Means     Amira.Weeks.Lapsed     18.9   2.10e-1 0             5     1       6
## 36 Means     Amira.Average.Weekl…    1.30  8.93e-2 3.19e- 48     5     1       6
## 37 Variances BOY.ARM               458.    1.12e+1 0             5     1       6
## 38 Variances Grade                   0.473 9.08e-3 0             5     1       6
## 39 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             5     1       6
## 40 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     5     1       6
## 41 Means     BOY.ARM                99.4   7.81e-1 0             6     1       6
## 42 Means     Grade                   2.40  1.62e-2 0             6     1       6
## 43 Means     Amira.Weeks.Lapsed     36.2   4.93e-2 0             6     1       6
## 44 Means     Amira.Average.Weekl…    2.78  5.05e-2 0             6     1       6
## 45 Variances BOY.ARM               458.    1.12e+1 0             6     1       6
## 46 Variances Grade                   0.473 9.08e-3 0             6     1       6
## 47 Variances Amira.Weeks.Lapsed      5.93  1.33e-1 0             6     1       6
## 48 Variances Amira.Average.Weekl…    2.91  1.26e-1 2.90e-117     6     1       6

Decided on model 3 - 3 groups