OHDSI Home | Forums | Wiki | Github

Error in executing PLE package

Hello.
I am stuck in error of PLE package (http://atlas-demo.ohdsi.org/#/estimation/cca/494). I cannot figure out and need helps. Thanks in advance

Creating exposure and outcome cohorts
Connecting using SQL Server driver
Creating cohort: ykgcaesystemicDXAusers
  |=====================================================================| 100%
Executing SQL took 6.73 secs
Creating cohort: ykgcaesystemicPDSusers
  |=====================================================================| 100%
Executing SQL took 7.27 secs
Creating cohort: ykgcaemskRelatedAE
  |=====================================================================| 100%
Executing SQL took 10.5 secs
Creating negative control outcome cohorts
  |=====================================================================| 100%
Executing SQL took 1.44 mins
Counting cohorts
Running CohortMethod analyses
*** Creating cohortMethodData objects ***
  |=====================================================================| 100%
*** Creating study populations ***
  |=====================================================================| 100%
*** Fitting shared propensity score models ***
Loading required package: CohortMethod
Loading required package: Cyclops
Loading required package: FeatureExtraction
Loading required package: Andromeda
Loading required package: dplyr

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

Fitting propensity model across all outcomes (ignore messages about 'no outcome specified')
Warning: The addExposureDaysToStart argument is deprecated. Please use the startAnchor argument instead.
Warning: The addExposureDaysToEnd argument is deprecated. Please use the endAnchor argument instead.
No outcome specified so skipping removing people with prior outcomes
Removing subjects with less than 1 day(s) at risk (if any)
No outcome specified so not creating outcome and time variables
Creating propensity scores took 0.0256 secs
*** Adding propensity scores to study population objects ***
  |=====================================================================| 100%
*** Trimming/Matching/Stratifying ***
  |=====================================================================| 100%
*** Prefiltering covariates for outcome models ***
*** Fitting outcome models for outcomes of interest ***
  |=====================================================================| 100%
*** Fitting outcome models for other outcomes ***
  |=====================================================================| 100%
Summarizing results
  |=====================================================================| 100%
Computing covariate balance
  |=====================================================================| 100%
Packaging results
Exporting analyses
- cohort_method_analysis table
- covariate_analysis table
Exporting exposures
- exposure_of_interest table
Exporting outcomes
- outcome_of_interest table
- negative_control_outcome table
Exporting metadata
Warning: no non-missing arguments to min; returning Inf
Warning: no non-missing arguments to min; returning Inf
- database table
- exposure_summary table
Error in aggregate.data.frame(lhs, mf[-1L], FUN = FUN, ...) : 
  no rows to aggregate
An error report has been created at  ./output_steroid/errorReportR.txt

And, the errorReportR.txt is followed

    Thread: Main
    Message:  Error in aggregate.data.frame(lhs, mf[-1L], FUN = FUN, ...) :    no rows to aggregate 
    Level:  FATAL
    Time:  2021-09-25 20:09:25

    Stack trace:
7: stop("no rows to aggregate")
6: aggregate.data.frame(lhs, mf[-1], FUN = FUN, ...)
5: aggregate.formula(minDate ~ exposureId, minDates, min)
4: Export.R#253: aggregate(minDate ~ exposureId, minDates, min)
3: Export.R#53: exportMetadata(outputFolder = outputFolder, exportFolder = ex
2: Main.R#134: exportResults(outputFolder = outputFolder, databaseId = databa
1: execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmData

R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-apple-darwin17.0

Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base

Other attached packages:
- CohortMethod (4.0.0)
- FeatureExtraction (3.0.1)
- Andromeda (0.3.2)
- dplyr (1.0.2)
- Cyclops (3.0.0)
- msk01 (0.0.1)
- DatabaseConnector (3.0.0)

I have the same error. I didn’t find the solution. But i guess the reason is no data were in the database.
That step is trying to use aggregate function, however, the row number is zero.

If we insist on running the following script, we can change packageResults = TRUE into packageResults = FALSE. But the final result still contains nothing.

This looks like an edge case where all exposure cohorts are empty. I think the real question is why the cohorts are empty? There should a CohortCounts.csv file in the output folder. Could you check if there are any entries for your exposure cohorts?

t