Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • import error

    Hello, i am trying to import data downloaded from REDCap using the same method that I have always successfully used in the past but am getting an error: too many variables specified
    r(103);


    Below is the code I have used. Any suggestions why the error?

    cd "/Users/u0521032/Library/CloudStorage/Box-Box/Research Studies 1 ([email protected]) (1)/Dephi_PTs_opioids/Data Analysis"
    /Users/u0521032/Library/CloudStorage/Box-Box/Research Studies 1 ([email protected]) (1)/Dephi_PTs_opioids/Data Analysis

    version 17
    clear

    import delimited record_id redcap_event_name redcap_repeat_instrument redcap_repeat_instance redcap_survey_identifier email email_field_complete demographics_timestamp age gender race___1 race___2 race___3 race___4 race___5 race___6 grad_year certification___1 certification___2 certification___3 certification___4 perc_msk perc_takeopioid hrs_trainmisuse demographics_complete knowledge_assessment_timestamp kt_misuse_def___1 kt_misuse_def___2 kt_misuse_def___3 kt_misuse_def___4 kt_misuse_def___5 kt_oud_quantity kt_op_prescribed_wds kt_oud_withdrawl kt_tolerance kt_synonymous kt_long_term kt_associated___1 kt_associated___2 kt_associated___3 kt_associated___4 kt_associated___5 kt_screening kt_alert kt_instruments kt_impair kt_medd kt_methadone kt_over90days kt_order kt_document kt_communicate knowledge_assessment_complete phys_ther_opiois_mis_v_0 oft_curropioid_fu1 oft_pastopioid_fu1 oft_goalopioid_fu1 oft_redopioid_fu1 oft_histmisuse_fu1 ptrole_opiodi_fu1 dd1_knowledge_fu1 dd2_causes_fu1 dd3_physical_fu1 dd4_psych_fu1 dd5_riskfactors_fu1 dd6_counsel_fu1 dd7_advise_fu1 dd8_questrights_fu1 dd9_askinfo_fu1 dd10_persondiff_fu1 dd11_personrespon_fu1 dd12_approach_fu1 dd13_littlecando_fu1 dd14_workwell_fu1 dd15_failure_fu1 dd16_respect_fu1 dd17_uncomfort_fu1 dd18_satisfy_fu1 dd19_reward_fu1 dd20_iunderstand_fu1 vignette_fu1 please_specify_other_fu1 freq1_ask_fu1 freq2_screen_fu1 freq3_assess_fu1 freq4_advise_fu1 freq5_refer_fu1 conf1_ask_fu1 conf2_screen_fu1 conf3_assess_fu1 conf4_advise_fu1 conf5_refer_fu1 phys_ther_opiois_mis_v_1 using "misuse_base_fu.csv", varnames(nonames)

  • #2
    I note that when I import up to but not including dd15_failure_fu1, the data import correctly.

    Comment


    • #3
      Have you tried running the command without the list of variable names?

      I see two possibilities if removing the list of variable names eliminates the error message.
      • You have run afoul of a (not obviously document) limit on the number of variable that can be renamed in a single command.
      • The number of variable names you specified does not agree with the number of variables actually found on the input records.

      Comment


      • #4
        I just tried importing a CSV file on my system while specifying 395 variable names in the import delimited command, and it worked fine. But the moment I specified more variable names than actual columns in my data, I received the same error.

        So I would go with the second possibility mentioned in #3.

        Comment


        • #5
          Thank you both. I went and downloaded the file again and for some wacky reason, it worked the second time. I have no idea why.

          Comment

          Working...
          X