Announcement

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

  • How to add value of 1 and Ln for multiple columns

    Hi
    I would like to ask how I can increase the value of a set of columns by 1. for example, A-Z+1, so all data in all columns will be increased by 1, and then I want to make transformations on all of them using Ln.

  • #2
    Look up how to make loops using -foreach or -forval. If you want guidance more specific to your problem, provide an example of your data using the -dataex command.

    Comment


    • #3
      Originally posted by Emil Alnor View Post
      Look up how to make loops using -foreach or -forval. If you want guidance more specific to your problem, provide an example of your data using the -dataex command.
      Actually I know that I have to use loop but I don't know how to write it. I used loop in regression always.

      Comment


      • #4
        Adding 1 to permit using ln() on variables with some zero values is widely regarded as undesirable, and questions surrounding it have been very frequently asked on this list, appearing at least once just in the last few weeks. Doing it to a whole list of variables, which might well have different scales of measurements, is an even worse idea. I'd encourage reading up on it before doing it. However, yes, it can be done with a loop.

        Comment

        Working...
        X