Hello Experts,
I have a code on R ( I do not code on R):
#if(noms == "Real Estate")
if(noms == Qimmo)
{
interpolation <- c()
date_affichage <- c()
for(annee in 1:(dim(tableau)[1]-1))
{
date_interpolation <- format(seq(as.Date(tableau$Date[annee], "%d/%m/%Y"), as.Date(tableau$Date[annee+1], "%d/%m/%Y"), by="days"), format = "%d/%m/%Y")
interpolation <- c(interpolation, approx(x = annee:(annee+1), y = tableau$Valeur[annee:(annee+1)], n=length(date_interpolation))$y )
date_affichage <- c(date_affichage, date_interpolation)
}
tableau <- data.frame(Date = unique(date_affichage), Valeur = unique(interpolation))
}
Do you know, please, the equivalent of this function on SAS please ? On Internet I have a lot of results, but I don't know which one is correct.
I have joined the data : I would like to have the values for all days in the year.
Thank you for your help !
I don't know R either, and all you say to point us in the right direction is these few words in the title: "Linear interpolation for annual data". You can follow these instructions: https://support.sas.com/kb/24/560.html
I don't know R either, and all you say to point us in the right direction is these few words in the title: "Linear interpolation for annual data". You can follow these instructions: https://support.sas.com/kb/24/560.html
@SASdevAnneMarie wrote:
My prolem is that I don't know how to do the linear interpolation for annual data. I have joined the data to my e-mail.
I guess I don't understand why you say that you don't know how ... the link I gave offers actual SAS code to do linear interpolation.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.