It joined the Malaysian Federation in 1963 but separated two years later and became independent .