<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I create a formula with multiple &amp;quot;if&amp;quot; conditions? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725695#M91050</link>
    <description>&lt;P&gt;Besides txnelson's suggestion, there are two non-script ways to accomplish what you decide to do.&amp;nbsp; If there are many different IF clauses, you may find Recoding the column to be the easiest way to do it.&amp;nbsp; To use the IF function and include multiple IF clauses, highlight the box for the Else clause and press the comma key.&amp;nbsp; That will add a second IF clause to the original dialog.&amp;nbsp; You can do this as many times as you want to get as many IF clauses as you desire (with the last one being Else).&amp;nbsp; As I said, if there are many of these, recoding is probably easier.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 12:14:09 GMT</pubDate>
    <dc:creator>dlehman1</dc:creator>
    <dc:date>2024-02-28T12:14:09Z</dc:date>
    <item>
      <title>How do I create a formula with multiple "if" conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725534#M91005</link>
      <description>&lt;P&gt;I'm working with a real estate data set. Several thousand rows are missing bathroom data. I'd like to write a formula for a new column that creates bathroom data based on the average bathroom by bedrooms data in the rest of the data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if baths is missing then beds &amp;lt;/= 2 is 1 bath, beds = 3 is 2, beds &amp;lt;/= 5 is 3, beds &amp;lt;/= 8 is 4, beds &amp;gt;/= 9 is 5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, is there a better way to estimate the bathroom data for the missing values?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 02:56:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725534#M91005</guid>
      <dc:creator>dbc</dc:creator>
      <dc:date>2024-02-27T02:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a formula with multiple "if" conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725548#M91006</link>
      <description>&lt;P&gt;Welcome to the Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My suggestion is that you plot the data with the number of beds on the Y axis, and the number of baths on the Y axis and the number of beds on the X axis.&amp;nbsp; Either Graph Builder of Fit Y by X will work for this.&amp;nbsp; From there you should be able to see what the best estimates for baths should be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also just use the mean value for the number of baths for each group of beds.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row(
	If( Is Missing( :baths ),
		:baths = Col Mean( :Baths, :Beds )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To handle your original specification, the script would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row(
	If( Is Missing( :baths ),
		If(
			:Beds &amp;lt;= 2, :Baths = 1,
			:Beds == 3, :Baths = 2,
			:Beds &amp;lt;= 5, :Baths = 3,
			:Beds &amp;lt;= 8, :Baths = 4,
			:Baths = 5
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 03:34:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725548#M91006</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-02-27T03:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a formula with multiple "if" conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725695#M91050</link>
      <description>&lt;P&gt;Besides txnelson's suggestion, there are two non-script ways to accomplish what you decide to do.&amp;nbsp; If there are many different IF clauses, you may find Recoding the column to be the easiest way to do it.&amp;nbsp; To use the IF function and include multiple IF clauses, highlight the box for the Else clause and press the comma key.&amp;nbsp; That will add a second IF clause to the original dialog.&amp;nbsp; You can do this as many times as you want to get as many IF clauses as you desire (with the last one being Else).&amp;nbsp; As I said, if there are many of these, recoding is probably easier.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 12:14:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725695#M91050</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-02-28T12:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a formula with multiple "if" conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725696#M91051</link>
      <description>&lt;P&gt;Sorry, I misread your question.&amp;nbsp; I see that you want to estimate the missing data.&amp;nbsp; I do think you need to start with a visualization - if there is a fairly close relationship between number of bedrooms or size with number of bathrooms, then it can make sense to estimate the missing data from the relationship derived from the nonmissing data.&amp;nbsp; If the relationship doesn't look very systematic, then this is probably not a good idea.&amp;nbsp; If you are building models using this data, then the Informative Missing option will take care of the missing data for you - but in a particular way.&amp;nbsp; It will replace missing continuous data with the average value (which may not be the best approach, depending on what the visualization tells you) and add a new indicator column for whether or not the data was missing (it adds that for continuous or nominal missing data).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 12:19:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/725696#M91051</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-02-28T12:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a formula with multiple "if" conditions?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/732064#M91409</link>
      <description>&lt;P&gt;To add the explanation by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/53879"&gt;@dlehman1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can also check the JMP notes here regarding IF statement:&lt;/P&gt;&lt;P&gt;&lt;A title="JMP If Function" href="https://www.jmp.com/support/help/en/17.2/index.shtml#page/jmp/if-function.shtml" target="_self"&gt;https://www.jmp.com/support/help/en/17.2/index.shtml#page/jmp/if-function.shtml&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 02:26:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-formula-with-multiple-quot-if-quot-conditions/m-p/732064#M91409</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2024-03-11T02:26:17Z</dc:date>
    </item>
  </channel>
</rss>

