cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

lag function

Hello

having issue implementing formula/script using lag function that will help populate a new column where original column has some missing data. so if rows 1-5 have x value and missing readings from 6-10 and a change in row 11 so rows 6-10 would be that x val

 

 

3 REPLIES 3
txnelson
Super User

Re: lag function

If I am correctly interpreting what you want, Given a data table

txnelson_0-1689878087478.png

The following formula will fill in the values in a new column as I believe you want them

If( Is Missing( :X ),
	Lag( :Y ),
	:X
)

txnelson_1-1689878204694.png

 

Jim

Re: lag function

Yes! 

jthi
Super User

Re: lag function

Besides using Lag() if your data is fairly simple and you want to only fill missing values by repeating earlier value, JMP does provide interactive option "Replace Missing with Previous Value"

jthi_0-1689878410995.png

 

-Jarmo

Recommended Articles