cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
WernerL
Level III

How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Hi JMP Community, I have a table with in the first column all days of the year and in the second column a significant number of missing values.

I am looking for a solution to replace in the second column (or create a new 3rd column) the missing values by Last Observation Carried Forward (LOCF)? I cannot seem to find this functionality in JMP?

Alternative, I would like to replace the missing values by K Nearest Neighbors, which I noticed is available for JMP Pro users. Is there a work around for regular JMP users?

Thank you for your help!

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Attached is a data table with a new column that contains a simple formula that creates your requested Carried Forward value.carriedforward.PNG

Jim

View solution in original post

julian
Community Manager Community Manager

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Hi @Werner,

I actually prefer a column formula solution like @txnelson suggested because it retains your original data, but in some cases you might find you want to simply fill-in those missing values with the previous value (I do this often when date ranges aren't spanned). If you have JMP 14 or newer, you can use the Replace Missing Values with Previous Values data table right-click function. Select the entire column, then right-click a cell > Fill > Replace Missing with Previous Value.

 

withprevious.gif

 

I hope this helps!

@julian 

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Attached is a data table with a new column that contains a simple formula that creates your requested Carried Forward value.carriedforward.PNG

Jim
julian
Community Manager Community Manager

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Hi @Werner,

I actually prefer a column formula solution like @txnelson suggested because it retains your original data, but in some cases you might find you want to simply fill-in those missing values with the previous value (I do this often when date ranges aren't spanned). If you have JMP 14 or newer, you can use the Replace Missing Values with Previous Values data table right-click function. Select the entire column, then right-click a cell > Fill > Replace Missing with Previous Value.

 

withprevious.gif

 

I hope this helps!

@julian 

txnelson
Super User

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

Well, once again I have been shown something new in JMP..... @julian  thanks 

Jim
WernerL
Level III

Re: How do I replace missing values in a column using Last Observation Carried Forward (LOCF), or K Nearest Neighbors (without JMP Pro)?

@julian , I agree with you that the solution proposed by @txnelson has the big benefit of maintaining the starting base, hence preferred. Many thanks both for your swift responses! WernerL