Announcement

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

  • #16

    Good mornig Nick Cox , SORRY if i wrote in a bad way (i don t know why) when i run the code below:
    twoway `call' xla(1/3 5/7 9/11 13/15 17/19, labsize(small) noticks valuelabel) legend(off) ytitle(Peso) xtitle("") yla(, ang(h)) xli(4(4)16, lw(vthin) lc(gs12)) /// xmla(2 "2" 6 "4" 10 "6" 14 "8" 18 "12", tlength(*7) tlc(none) labsize(medlarge)) yla(, ang(h))
    Stata gives the error I dont know why errorr(100); ) required Can you help me please?

    Comment


    • #17
      Please read 12.3 at https://www.statalist.org/forums/help#stata and then post your code using CODE delimiters.

      Note that the /// continuation does not work within the Command window. You must run the code all at once from a do-file or do-file editor window.

      Comment


      • #18

        Good morning, When I run THE LAST TWO LINE stata gives to the same error: ) required r(100); end of do-file Where is the mistake please Nick Cox

        Comment


        • #19
          Always the same error...

          Comment


          • #20
            You can't run the last two lines separately from the definition of local macro call. Stata must be able to see the definition of call when you want to use it.

            Otherwise, please present code as we ask.

            Comment


            • #21
              wHEN I RUN THE CODR BELOW

              # twoway `call' xla(1/3 5/7 9/11 13/15 17/19, labsize(small) noticks valuelabel) legend(off) ytitle(Peso) xtitle("") yla(, ang(h)) xli(4(4)16, lw(vthin) lc(gs12)) ///
              xmla(2 "2" 6 "4" 10 "6" 14 "8" 18 "12", tlength(*7) tlc(none) labsize(medlarge)) yla(, ang(h))

              ) required
              r(100);

              end of do-file

              r(100);
              WHERE IS THE ERROR?

              Comment


              • #22
                thank you...
                I understand...
                thank you very much

                Comment


                • #23
                  I understand your frustration at getting code to work, but please don't repeat the same post just a few minutes later and please tone down your use of CAPITAL LETTERS, widely held to connote SHOUTING.

                  I take #22 to mean that you got the code working.

                  Comment


                  • #24
                    Thank you so much with all my heart Nick Cox

                    Comment


                    • #25
                      Good afternoon Nick Cox


                      Code:
                      * Example generated by -dataex-. To install: ssc install dataex
                      clear
                      input str3 Litter str6 Strain str3 Strain_old byte Pnd double Temperatura
                      "1B"  "B6_2"   "B6"   2    .
                      "2B"  "B6_2"   "B6"   2 27.6
                      "3B"  "B6_2"   "B6"   2 26.8
                      "4B"  "B6_2"   "B6"   2 29.3
                      "5B"  "B6_2"   "B6"   2 30.3
                      "6B"  "B6_2"   "B6"   2 27.7
                      "7B"  "B6_2"   "B6"   2 29.5
                      "8B"  "B6_2"   "B6"   2 28.1
                      "1B"  "B6_4"   "B6"   4 30.5
                      "2B"  "B6_4"   "B6"   4 29.6
                      "3B"  "B6_4"   "B6"   4 30.6
                      "4B"  "B6_4"   "B6"   4 30.4
                      "5B"  "B6_4"   "B6"   4 31.2
                      "6B"  "B6_4"   "B6"   4 32.1
                      "7B"  "B6_4"   "B6"   4 30.8
                      "8B"  "B6_4"   "B6"   4 31.8
                      "1B"  "B6_6"   "B6"   6 31.4
                      "2B"  "B6_6"   "B6"   6 31.4
                      "3B"  "B6_6"   "B6"   6 31.5
                      "4B"  "B6_6"   "B6"   6 30.2
                      "5B"  "B6_6"   "B6"   6 31.2
                      "6B"  "B6_6"   "B6"   6 32.5
                      "7B"  "B6_6"   "B6"   6 31.7
                      "8B"  "B6_6"   "B6"   6 32.5
                      "1B"  "B6_8"   "B6"   8 33.1
                      "2B"  "B6_8"   "B6"   8 31.7
                      "3B"  "B6_8"   "B6"   8 30.1
                      "4B"  "B6_8"   "B6"   8 32.7
                      "5B"  "B6_8"   "B6"   8 33.3
                      "6B"  "B6_8"   "B6"   8 31.8
                      "7B"  "B6_8"   "B6"   8 32.9
                      "8B"  "B6_8"   "B6"   8 32.4
                      "1B"  "B6_12"  "B6"  12 33.4
                      "2B"  "B6_12"  "B6"  12 32.9
                      "3B"  "B6_12"  "B6"  12 30.2
                      "4B"  "B6_12"  "B6"  12 33.5
                      "5B"  "B6_12"  "B6"  12 33.8
                      "6B"  "B6_12"  "B6"  12 34.4
                      "7B"  "B6_12"  "B6"  12 33.8
                      "8B"  "B6_12"  "B6"  12 34.3
                      "1F"  "FVB_2"  "FVB"  2 31.8
                      "2F"  "FVB_2"  "FVB"  2 29.7
                      "3F"  "FVB_2"  "FVB"  2 30.4
                      "4F"  "FVB_2"  "FVB"  2 30.3
                      "5F"  "FVB_2"  "FVB"  2 30.3
                      "6F"  "FVB_2"  "FVB"  2 29.7
                      "7F"  "FVB_2"  "FVB"  2 30.9
                      "8F"  "FVB_2"  "FVB"  2 30.8
                      "9F"  "FVB_2"  "FVB"  2 30.5
                      "10F" "FVB_2"  "FVB"  2 31.1
                      "1F"  "FVB_4"  "FVB"  4   31
                      "2F"  "FVB_4"  "FVB"  4 31.5
                      "3F"  "FVB_4"  "FVB"  4 31.3
                      "4F"  "FVB_4"  "FVB"  4 30.9
                      "5F"  "FVB_4"  "FVB"  4 31.1
                      "6F"  "FVB_4"  "FVB"  4 31.7
                      "7F"  "FVB_4"  "FVB"  4 30.8
                      "8F"  "FVB_4"  "FVB"  4 31.6
                      "9F"  "FVB_4"  "FVB"  4 30.8
                      "10F" "FVB_4"  "FVB"  4 31.3
                      "1F"  "FVB_6"  "FVB"  6 31.7
                      "2F"  "FVB_6"  "FVB"  6 32.1
                      "3F"  "FVB_6"  "FVB"  6 30.8
                      "4F"  "FVB_6"  "FVB"  6 32.5
                      "5F"  "FVB_6"  "FVB"  6 31.4
                      "6F"  "FVB_6"  "FVB"  6 32.6
                      "7F"  "FVB_6"  "FVB"  6 32.3
                      "8F"  "FVB_6"  "FVB"  6 32.8
                      "9F"  "FVB_6"  "FVB"  6 32.2
                      "10F" "FVB_6"  "FVB"  6 33.6
                      "1F"  "FVB_8"  "FVB"  8 33.4
                      "2F"  "FVB_8"  "FVB"  8 33.4
                      "3F"  "FVB_8"  "FVB"  8 30.8
                      "4F"  "FVB_8"  "FVB"  8 32.2
                      "5F"  "FVB_8"  "FVB"  8 32.1
                      "6F"  "FVB_8"  "FVB"  8 33.1
                      "7F"  "FVB_8"  "FVB"  8   32
                      "8F"  "FVB_8"  "FVB"  8 32.9
                      "9F"  "FVB_8"  "FVB"  8 33.5
                      "10F" "FVB_8"  "FVB"  8 33.8
                      "1F"  "FVB_12" "FVB" 12 33.9
                      "2F"  "FVB_12" "FVB" 12   34
                      "3F"  "FVB_12" "FVB" 12 31.5
                      "4F"  "FVB_12" "FVB" 12 34.1
                      "5F"  "FVB_12" "FVB" 12 33.4
                      "6F"  "FVB_12" "FVB" 12 34.6
                      "7F"  "FVB_12" "FVB" 12 33.7
                      "8F"  "FVB_12" "FVB" 12 34.3
                      "9F"  "FVB_12" "FVB" 12 34.6
                      "10F" "FVB_12" "FVB" 12 34.4
                      "1C"  "CD1_2"  "CD1"  2 30.7
                      "2C"  "CD1_2"  "CD1"  2 30.2
                      "3C"  "CD1_2"  "CD1"  2 30.9
                      "4C"  "CD1_2"  "CD1"  2 29.3
                      "5C"  "CD1_2"  "CD1"  2 28.7
                      "6C"  "CD1_2"  "CD1"  2 29.9
                      "7C"  "CD1_2"  "CD1"  2 30.2
                      "8C"  "CD1_2"  "CD1"  2 30.2
                      "9C"  "CD1_2"  "CD1"  2 31.1
                      "10C" "CD1_2"  "CD1"  2 30.7
                      end


                      I 've to do the same thing for the variable "Temperature".
                      I ran the same program you wrote and i obtained the figure (I replaced "Peso" with Temperatura") I attached. why did i get this? where is the mistake? Thanks a lot!!!
                      Attached Files

                      Comment


                      • #26
                        Sorry I use the correct format
                        Attached Files

                        Comment


                        • #27

                          I really don't understand what happened Nick Cox

                          Comment


                          • #28
                            You can edit your posts within 1 hour of original posting.

                            Please show the actual code you used. Don't ask us to guess or puzzle out what it might have been.

                            Comment


                            • #29
                              Code:
                              label def order 1 B6 2 FVB 3 CD1 
                              encode Strain_old, gen(order) label(order) 
                              sort Pnd order 
                              gen axis = sum(Pnd != Pnd[_n-1]) + sum(order != order[_n-1]) - 1 
                              
                              labmask axis, values(Strain_old)
                              
                              set scheme s1color
                              
                              bysort Strain: egen med = median(Temperatura)
                              by Strain: egen lqt = pctile(Temperatura), p(25)
                              by Strain: egen uqt = pctile(Temperatura), p(75)
                              
                              local colours gray blue green  
                              
                              foreach value in B6 FVB CD1 {
                                  gettoken colour colours : colours 
                                  local call `call' || rbar lqt med axis if Strain_old == "`value'", barw(0.6) fcolor(none) lcolor(`colour') ///
                                  || rbar uqt med axis if Strain_old == "`value'", barw(0.6) fcolor(none) lcolor(`colour') ///
                                  || scatter Peso axis if Strain_old == "`value'", mc(`colour') ms(Oh)
                              }
                              
                              twoway `call' xla(1/3 5/7 9/11 13/15 17/19, labsize(small) noticks valuelabel) legend(off) ytitle(Temperature °C) xtitle("") yla(, ang(h)) xli(4(4)16, lw(vthin) lc(gs12)) /// 
                              xmla(2 "2" 6 "4" 10 "6" 14 "8" 18 "12", tlength(*7) tlc(none) labsize(small)) yla(, ang(h))

                              Comment


                              • #30
                                .I wrote the code Nick Cox ( #29)
                                Sorry in advances I apologize and thank you in advance but I am a new user.

                                Comment

                                Working...
                                X