Announcement

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

  • invalid error using nwcommands

    Hi everyone!

    I want to use the nwcommands to do some social network analysis and encountered a problem. I installed the nwcommands and the process seemed to go well. But after installation, no matter what network command I entered, even something as simple as "webuse + some network data" the invalid error is always reported. I uninstalled the package and installed again, but the same thing happened. Here is a snapshot of the error return.
    Click image for larger version

Name:	360截图18430704291846.png
Views:	1
Size:	4.0 KB
ID:	1490723


    I wonder if anyone encountered the same problem or have any idea about what is going on here~ Really many thanks!

    Best,
    Jingyuan



  • #2
    I installed the nwcommands_ado and nwcommands_hlp packages and then ran the following commands suggested by help nwfromedge, correcting one error in the suggested nwfromedge command.
    Code:
    .  webnwuse glasgow, nwclear
    
    Loading successful
    (3 networks)
    --------------------
          glasgow1
          glasgow2
          glasgow3
    
    . nwtoedge glasgow1
    
    . nwfromedge _fromid _toid glasgow1, name(mynet)
    
    Loading successful
    --------------------------------------------------
       Network name:  mynet
       Network id:  4
       Directed: true
       Nodes: 50
       Arcs: 113
       Minimum value:  0
       Maximum value:  1
       Density:  .0461224489795918
    One possibility is that your data is causing an unanticipated problem in the nwfromedge command. Perhaps you should try recreating what I show above and seeing if it works. If so, the problem lies in your data. If you are using string variables for the fromid and toid variables, if any of them contain an apostrophe, I would not be surprised if that caused the problem you report.

    Another possibility is that your version of Stata is old (you don't mention is the version of Stata you are using, as requested in the Statalist FAQ linked to from the Advice on Posting link on the page you used to create your post). Normally that would not be a problem, but the author of the nwcommands did not use version control to ensure that the version of Stata running the commands was at least as new as the version on which it was written. The original version of nwfromedge dates from 8 December 2014 which suggests that it was written using Stata 13, but it has been updated subsequently.

    Comment


    • #3
      Originally posted by William Lisowski View Post
      I installed the nwcommands_ado and nwcommands_hlp packages and then ran the following commands suggested by help nwfromedge, correcting one error in the suggested nwfromedge command.
      Code:
      . webnwuse glasgow, nwclear
      
      Loading successful
      (3 networks)
      --------------------
      glasgow1
      glasgow2
      glasgow3
      
      . nwtoedge glasgow1
      
      . nwfromedge _fromid _toid glasgow1, name(mynet)
      
      Loading successful
      --------------------------------------------------
      Network name: mynet
      Network id: 4
      Directed: true
      Nodes: 50
      Arcs: 113
      Minimum value: 0
      Maximum value: 1
      Density: .0461224489795918
      One possibility is that your data is causing an unanticipated problem in the nwfromedge command. Perhaps you should try recreating what I show above and seeing if it works. If so, the problem lies in your data. If you are using string variables for the fromid and toid variables, if any of them contain an apostrophe, I would not be surprised if that caused the problem you report.

      Another possibility is that your version of Stata is old (you don't mention is the version of Stata you are using, as requested in the Statalist FAQ linked to from the Advice on Posting link on the page you used to create your post). Normally that would not be a problem, but the author of the nwcommands did not use version control to ensure that the version of Stata running the commands was at least as new as the version on which it was written. The original version of nwfromedge dates from 8 December 2014 which suggests that it was written using Stata 13, but it has been updated subsequently.



      Hi William,


      Thank you a lot for your detailed reply. For the two possibilities you mentioned.

      First, I don't think it is likely to be caused by the data. The invalid error does not only appear with nwfromedge command. That is even when I entered something like "webnwuse glasgow, nwclear", it still report the same invalid error. Also, last night I tried to use another computer of the school to run the data, it actually worked well. I am thinking maybe this is caused by the setting of my laptop? But don't know where is wrong.

      Second, sorry to not mention my Stata version. Mine is Stata SE. 15.0.

      Really confusing. Thanks again for your reply!


      Jingyuan

      Comment


      • #4
        It would not be a bad idea to update your Stata to 15.1. Type update all in the command window. Unlike version upgrades, within-version updates are free.

        Comment

        Working...
        X