Re: Finding closest value

I took out the value of mean and find the closest value from the data set. so I have only one observation and 5 variables in a dataset.

now based on a variable on this dataset i want to extract observation from other dataset can anyone help me with this ?

dataset1

_imputation_ _freq_ father_mean mother_mean

45 934 64.21321 65.34324

dataset2

_imputation_ fahter mother child

1 64 62 45

2 67 66 34

45 45 23 23

45 34 23 12

and so on in dataset2 i have 90,000 observation from which 934 observation has same _imputation_. I want to have it dynamic because everytime i run my program this value 45 will change. from dataset2 based on this value(45 for this case) i want to keep observation and rest all I want to delete.

Re: Finding closest value

i have two dataset. in both dataset there is one variable common _imputation_. In dataset2 i have too many observation and i want to keep only those observation where _imputation_ value is same in both dataset. rest I want to delete.

Re: Finding closest value

I am writing it again. I did accept it because for the second question I asked he gave me the right solution for it.

Here is my full question

I have two dataset in which i want to find closest or nearest value in dataset1 based on dataset2. My dataset have over 90,000 values. For easy to understand and answer i am just writing a part of dataset.

in dataset1 I have three variables and 5 observations.

_imp_ father_mean1

46 69.132352143

51 69.173300123

37 69.180984823

105 69.123531423

981 69.162347234

in dataset2 I have two varibales and one observation

_freq_ father_mean1

9 69.174400123

As an output in dataset1 I want to find closest value for father_mean on the bases of father_mean in dataset2. so the output should be

_imp_ father_mean

51 69.173300123

this was the first part and for second part I got the right solution. please.